Skip to content

Commit

Permalink
Fixed #100
Browse files Browse the repository at this point in the history
  • Loading branch information
Gillardo committed Mar 3, 2016
1 parent bc30ff2 commit ae0a3ea
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 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": "2.2.0",
"version": "2.2.1",
"homepage": "https://github.com/Gillardo/bootstrap-ui-datetime-picker",
"authors": [
"Gillardo <[email protected]>"
Expand Down
6 changes: 3 additions & 3 deletions datetime-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
var options = scope.$parent.$eval(attrs.datepickerOptions);

if (options && options.initDate) {
scope.initDate = dateParser.fromTimezone(options.initDate, ngModelOptions.timezone);
scope.initDate = uibDateParser.fromTimezone(options.initDate, ngModelOptions.timezone);
datepickerEl.attr('init-date', 'initDate');
delete options.initDate;
}
Expand Down Expand Up @@ -224,7 +224,7 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
scope.date = value;
return value;
}
scope.date = uibDateParser.fromTimezone(value, ngModelOptions.timezone);;
scope.date = uibDateParser.fromTimezone(value, ngModelOptions.timezone);
dateFormat = dateFormat.replace(/M!/, 'MM')
.replace(/d!/, 'dd');

Expand Down Expand Up @@ -301,7 +301,7 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
var defaultTime = angular.isDefined(attrs.defaultTime) ? attrs.defaultTime : uiDatetimePickerConfig.defaultTime;
var t = new Date('2001-01-01 ' + defaultTime);

if (!isNaN(t)) {
if (!isNaN(t) && dt != null) {
dt.setHours(t.getHours());
dt.setMinutes(t.getMinutes());
dt.setSeconds(t.getSeconds());
Expand Down
10 changes: 5 additions & 5 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.2.0
// Released: 2016-01-28
// Version: 2.2.1
// Released: 2016-03-03
angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.position'])
.constant('uiDatetimePickerConfig', {
dateFormat: 'yyyy-MM-dd HH:mm',
Expand Down Expand Up @@ -120,7 +120,7 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
var options = scope.$parent.$eval(attrs.datepickerOptions);

if (options && options.initDate) {
scope.initDate = dateParser.fromTimezone(options.initDate, ngModelOptions.timezone);
scope.initDate = uibDateParser.fromTimezone(options.initDate, ngModelOptions.timezone);
datepickerEl.attr('init-date', 'initDate');
delete options.initDate;
}
Expand Down Expand Up @@ -214,7 +214,7 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
scope.date = value;
return value;
}
scope.date = uibDateParser.fromTimezone(value, ngModelOptions.timezone);;
scope.date = uibDateParser.fromTimezone(value, ngModelOptions.timezone);
dateFormat = dateFormat.replace(/M!/, 'MM')
.replace(/d!/, 'dd');

Expand Down Expand Up @@ -291,7 +291,7 @@ angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bo
var defaultTime = angular.isDefined(attrs.defaultTime) ? attrs.defaultTime : uiDatetimePickerConfig.defaultTime;
var t = new Date('2001-01-01 ' + defaultTime);

if (!isNaN(t)) {
if (!isNaN(t) && dt != null) {
dt.setHours(t.getHours());
dt.setMinutes(t.getMinutes());
dt.setSeconds(t.getSeconds());
Expand Down
Loading

0 comments on commit ae0a3ea

Please sign in to comment.