Skip to content

Commit

Permalink
upd calendar to utc dates
Browse files Browse the repository at this point in the history
  • Loading branch information
olton committed Nov 30, 2014
1 parent b6f1b11 commit 71ed253
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/js/metro/metro-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
if (element.data('weekStart') != undefined) this.options.weekStart = element.data('weekStart');
if (element.data('otherDays') != undefined) this.options.otherDays = element.data('otherDays');

this._year = this.options.date.getFullYear();
this._distance = parseInt(this.options.date.getFullYear())-4;
this._month = this.options.date.getMonth();
this._day = this.options.date.getDate();
this._year = this.options.date.getUTCFullYear();
this._distance = parseInt(this.options.date.getUTCFullYear())-4;
this._month = this.options.date.getUTCMonth();
this._day = this.options.date.getUTCDate();
this._mode = this.options.startMode;

element.data("_storage", []);
Expand All @@ -67,7 +67,7 @@

var totalDays = ["31", ""+feb+"","31","30","31","30","31","31","30","31","30","31"];
var daysInMonth = totalDays[month];
var first_week_day = new Date(year, month, 1).getDay();
var first_week_day = new Date(year, month, 1).getUTCDay();

var table, tr, td, i;

Expand Down Expand Up @@ -404,7 +404,7 @@
setDate: function(d){
var r;
d = new Date(d);
r = (new Date(d.getFullYear()+"/"+ (d.getMonth()+1)+"/"+ d.getDate())).format('yyyy-mm-dd');
r = (new Date(d.getUTCFullYear()+"/"+ (d.getUTCMonth()+1)+"/"+ d.getUTCDate())).format('yyyy-mm-dd');
this._addDate(r);
this._renderCalendar();
},
Expand All @@ -420,7 +420,7 @@
unsetDate: function(d){
var r;
d = new Date(d);
r = (new Date(d.getFullYear()+"-"+ (d.getMonth()+1)+"-"+ d.getDate())).format('yyyy-mm-dd');
r = (new Date(d.getUTCFullYear()+"-"+ (d.getUTCMonth()+1)+"-"+ d.getUTCDate())).format('yyyy-mm-dd');
this._removeDate(r);
this._renderCalendar();
},
Expand Down

0 comments on commit 71ed253

Please sign in to comment.