Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
Added module.exports to dist
Fixed #166
  • Loading branch information
Gillardo committed Jan 19, 2017
1 parent ecc3e5b commit 50e4eda
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 57 deletions.
94 changes: 50 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,52 +81,58 @@ Now datetimePicker options are globally set by default. If you do not state the

```
.constant('uiDatetimePickerConfig', {
dateFormat: 'yyyy-MM-dd HH:mm',
defaultTime: '00:00:00',
html5Types: {
date: 'yyyy-MM-dd',
'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss',
'month': 'yyyy-MM'
dateFormat: 'yyyy-MM-dd HH:mm',
defaultTime: '00:00:00',
html5Types: {
date: 'yyyy-MM-dd',
'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss',
'month': 'yyyy-MM'
},
initialPicker: 'date',
reOpenDefault: false,
enableDate: true,
enableTime: true,
buttonBar: {
show: true,
now: {
show: true,
text: 'Now',
cls: 'btn-sm btn-default'
},
today: {
show: true,
text: 'Today',
cls: 'btn-sm btn-default'
},
clear: {
show: true,
text: 'Clear',
cls: 'btn-sm btn-default'
},
date: {
show: true,
text: 'Date',
cls: 'btn-sm btn-default'
},
initialPicker: 'date',
reOpenDefault: false,
enableDate: true,
enableTime: true,
buttonBar: {
time: {
show: true,
now: {
show: true,
text: 'Now'
},
today: {
show: true,
text: 'Today'
},
clear: {
show: true,
text: 'Clear'
},
date: {
show: true,
text: 'Date'
},
time: {
show: true,
text: 'Time'
},
close: {
show: true,
text: 'Close'
}
text: 'Time',
cls: 'btn-sm btn-default'
},
closeOnDateSelection: true,
closeOnTimeNow: true,
appendToBody: false,
altInputFormats: [],
ngModelOptions: { },
saveAs: false,
readAs: false,
})
close: {
show: true,
text: 'Close',
cls: 'btn-sm btn-default'
}
},
closeOnDateSelection: true,
closeOnTimeNow: true,
appendToBody: false,
altInputFormats: [],
ngModelOptions: {},
saveAs: false,
readAs: false
})
```

## Css
Expand All @@ -146,7 +152,7 @@ Applied when the date picker is visible
```
.datetime-picker-dropdown > li.time-picker-menu
```
Applied when the time picker is visible
Applied when the time picker is visible. The buttons in the buttonBars can be overridden by setting the css classes as stated above

###### EXAMPLE
For example, if i add this css code, you will see the difference to the calendar in the images below
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-ui-datetime-picker",
"version": "2.5.0",
"version": "2.5.1",
"homepage": "https://github.com/Gillardo/bootstrap-ui-datetime-picker",
"authors": [
"Gillardo <[email protected]>"
Expand Down
10 changes: 8 additions & 2 deletions datetime-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,14 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo

$scope.keydown = function (evt) {
if (evt.which === 27) {
evt.preventDefault();
evt.stopPropagation();

$scope.close(false);
$element[0].focus();

$timeout(function(){
$element[0].focus();
}, 0);
}
};

Expand Down Expand Up @@ -661,4 +667,4 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
transclude: true,
templateUrl: 'template/time-picker.html'
};
});
});
15 changes: 11 additions & 4 deletions dist/datetime-picker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://github.com/Gillardo/bootstrap-ui-datetime-picker
// Version: 2.5.0
// Released: 2017-01-12
// Version: 2.5.1
// Released: 2017-01-19
angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.position'])
.constant('uiDatetimePickerConfig', {
dateFormat: 'yyyy-MM-dd HH:mm',
Expand Down Expand Up @@ -292,8 +292,14 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo

$scope.keydown = function (evt) {
if (evt.which === 27) {
evt.preventDefault();
evt.stopPropagation();

$scope.close(false);
$element[0].focus();

$timeout(function(){
$element[0].focus();
}, 0);
}
};

Expand Down Expand Up @@ -665,7 +671,6 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
templateUrl: 'template/time-picker.html'
};
});

angular.module('ui.bootstrap.datetimepicker').run(['$templateCache', function($templateCache) {
'use strict';

Expand All @@ -679,3 +684,5 @@ angular.module('ui.bootstrap.datetimepicker').run(['$templateCache', function($t
);

}]);

module.exports = 'ui.bootstrap.datetimepicker';
6 changes: 3 additions & 3 deletions dist/datetime-picker.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function (grunt) {
ngtemplates: {
app: {
src: [
'template/*.html',
'template/*.html'
],
dest: 'dist/datetime-picker.tpls.js',
options: {
Expand All @@ -33,7 +33,8 @@ module.exports = function (grunt) {
app: {
src: [
'datetime-picker.js',
'<%= ngtemplates.app.dest %>'
'<%= ngtemplates.app.dest %>',
'module-export.js'
],
dest: 'dist/datetime-picker.js'
}
Expand Down
1 change: 1 addition & 0 deletions module-export.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'ui.bootstrap.datetimepicker';

This comment has been minimized.

Copy link
@lucasgranberg

lucasgranberg Jan 19, 2017

This breaks my application.
"Uncaught ReferenceError: module is not defined at datetime-picker.js:688"

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-ui-datetime-picker",
"version": "2.5.0",
"version": "2.5.1",
"url": "https://github.com/Gillardo/bootstrap-ui-datetime-picker",
"authors": [
"Gillardo <[email protected]>"
Expand Down

2 comments on commit 50e4eda

@Gillardo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added by a PR originally and I deleted it but people have asked for it back... if I add an if to check if module is declared does that fix it your end??

@lucasgranberg
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so yes. If you want to make everybody happy maybe use something like this:
https://github.com/umdjs/umd

Please sign in to comment.