Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
Revert "xtreme-christophe-fargette - Remove the Date.UTC to generate …
Browse files Browse the repository at this point in the history
…the title of the datepicker."

This reverts commit 327ca84.
  • Loading branch information
mgcrea committed Jan 23, 2014
1 parent 67dea92 commit 04e7767
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ angular.module('mgcrea.ngStrap.datepicker', ['mgcrea.ngStrap.tooltip'])
},
build: function() {
var days = [], day;
var firstDayOfMonth = new Date(viewDate.year, viewDate.month, 1);
var firstDayOfMonth = new Date(Date.UTC(viewDate.year, viewDate.month, 1));
var firstDate = new Date(+firstDayOfMonth - (firstDayOfMonth.getUTCDay() + 1 - options.weekStart) * 864e5);
// lastDate = new Date(Date.UTC(firstDate.getUTCFullYear(), firstDate.getUTCMonth(), firstDate.getUTCDate() + 1, 0, 0, 0, -1));
for(var i = 0; i < 35; i++) {
Expand Down Expand Up @@ -529,7 +529,7 @@ angular.module('mgcrea.ngStrap.datepicker', ['mgcrea.ngStrap.tooltip'])
build: function() {
var months = [], month;
for (var i = 0; i < 12; i++) {
month = new Date(viewDate.year, i, 1);
month = new Date(Date.UTC(viewDate.year, i, 1));
months.push({date: month, label: dateFilter(month, this.format), selected: picker.$isSelected(month), disabled: this.isDisabled(month)});
}
scope.title = dateFilter(month, 'yyyy');
Expand Down Expand Up @@ -573,7 +573,7 @@ angular.module('mgcrea.ngStrap.datepicker', ['mgcrea.ngStrap.tooltip'])
var firstYear = viewDate.year - viewDate.year % (this.split * 3);
var years = [], year;
for (var i = 0; i < 12; i++) {
year = new Date(firstYear + i, 0, 1);
year = new Date(Date.UTC(firstYear + i, 0, 1));
years.push({date: year, label: dateFilter(year, this.format), selected: picker.$isSelected(year), disabled: this.isDisabled(year)});
}
scope.title = years[0].label + '-' + years[years.length - 1].label;
Expand Down

0 comments on commit 04e7767

Please sign in to comment.