Skip to content

Commit

Permalink
Issue #17
Browse files Browse the repository at this point in the history
Pressing Clear when using date and time, after intial value is selected,
threw error.
  • Loading branch information
Gillardo committed Apr 22, 2015
1 parent 0f5ae55 commit b8fb05f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
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": "1.0.18",
"version": "1.0.19",
"homepage": "https://github.com/Gillardo/bootstrap-ui-datetime-picker",
"authors": [
"Gillardo <[email protected]>"
Expand Down
4 changes: 2 additions & 2 deletions datetime-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@
// we will use, if its the timePicker but enableDate = true, we need to merge
// the values, else timePicker will reset the date
if (scope.enableDate && scope.enableTime && scope.showPicker === 'time') {
if (currentDate && currentDate !== null && (scope.date !== null || dt)) {
if (currentDate && currentDate !== null && (scope.date !== null || dt || dt != null)) {
// dt will not be undefined if the now or today button is pressed
if (angular.isDefined(dt)) {
if (dt && dt != null) {
currentDate.setHours(dt.getHours());
currentDate.setMinutes(dt.getMinutes());
currentDate.setSeconds(dt.getSeconds());
Expand Down
8 changes: 4 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: 1.0.18
// Released: 2015-04-10
// Version: 1.0.19
// Released: 2015-04-22
angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.position'])
.directive('datetimePicker', ['$compile', '$parse', '$document', '$timeout', '$position', 'dateFilter', 'dateParser', 'datepickerPopupConfig',
function ($compile, $parse, $document, $timeout, $position, dateFilter, dateParser, datepickerPopupConfig) {
Expand Down Expand Up @@ -161,9 +161,9 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
// we will use, if its the timePicker but enableDate = true, we need to merge
// the values, else timePicker will reset the date
if (scope.enableDate && scope.enableTime && scope.showPicker === 'time') {
if (currentDate && currentDate !== null && (scope.date !== null || dt)) {
if (currentDate && currentDate !== null && (scope.date !== null || dt || dt != null)) {
// dt will not be undefined if the now or today button is pressed
if (angular.isDefined(dt)) {
if (dt && dt != null) {
currentDate.setHours(dt.getHours());
currentDate.setMinutes(dt.getMinutes());
currentDate.setSeconds(dt.getSeconds());
Expand Down
6 changes: 3 additions & 3 deletions dist/datetime-picker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bootstrap-ui-datetime-picker",
"url": "https://github.com/Gillardo/bootstrap-ui-datetime-picker",
"version": "1.0.18",
"version": "1.0.19",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-angular-templates": "^0.5.7",
Expand Down

0 comments on commit b8fb05f

Please sign in to comment.