From 61e8962f9674618ddb1704279751900e9c292caa Mon Sep 17 00:00:00 2001 From: Manson Wang Date: Wed, 5 Mar 2014 10:19:42 +0800 Subject: [PATCH] Fix bootstrap-datetimepicker timezone setting --- app/assets/javascripts/lib/bootstrap-datetimepicker.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/lib/bootstrap-datetimepicker.js b/app/assets/javascripts/lib/bootstrap-datetimepicker.js index 27fc133..a4ff68b 100644 --- a/app/assets/javascripts/lib/bootstrap-datetimepicker.js +++ b/app/assets/javascripts/lib/bootstrap-datetimepicker.js @@ -175,6 +175,7 @@ this._date = this.parseDate(newDate); } else { this._date = new Date(newDate); + this._date.setTime( this._date.getTime() - this._date.getTimezoneOffset()*60*1000 ); } this.set(); this.viewDate = UTCDate(this._date.getUTCFullYear(), this._date.getUTCMonth(), 1, 0, 0, 0, 0);