rchavik / bootstrap-datepicker

A datepicker for @twitter bootstrap forked from Stefan Petre's (of eyecon.ro), improvements by @eternicode
Apache License 2.0
2 stars 3 forks source link

UTC time parsing bug #6

Open korun opened 9 years ago

korun commented 9 years ago

From: https://github.com/eternicode/bootstrap-datepicker/pull/909

First off , this is by far the most simple and easy to use time picker! Great job... I think I have found a bug in this fork regarding UTC time parsing but I'm not sure how to fix it yet.

The bug goes like this.

I'm in gmt+2 time zone and I set the date time picker with a date string like this:

$('#end-date').datepicker('update', '27/12/2014 23:59');

When I open the datepicker and I try to select a day back (the 26th) I can't because of the following line:

this._setDate(UTCDate(year, month, day, h, m, s));

year = 2014 , month = 11, day = 26 , h = 23 , m = 59 , s = 0 UTCDate(year, month, day, h, m, s) = Fri Dec 27 2013 01:59:00 GMT+020

the result is that nothing changes...

I tried playing with the date changing the timezone offset and what not without luck.

Any ideas?

Not to forget.

korun commented 9 years ago

I'll need to check this later: https://github.com/eternicode/bootstrap-datepicker/issues/1157