Skip to content

Commit 6d0e5ba

Browse files
Fix for trentrichardson#588 DST bug
1 parent 6d9f0f4 commit 6d0e5ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jquery-ui-timepicker-addon.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,11 @@
15891589
// object will only return the timezone offset for the current locale, so we
15901590
// adjust it accordingly. If not using timezone option this won't matter..
15911591
// If a timezone is different in tp, keep the timezone as is
1592-
if(tp_inst && tp_inst.timezone != null){
1592+
if(tp_inst){
1593+
// look out for DST if tz wasn't specified
1594+
if(tp_inst._defaults.timezone === null){
1595+
tp_inst.timezone = tp_date.getTimezoneOffset()*-1;
1596+
}
15931597
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
15941598
tp_date = $.timepicker.timezoneAdjust(tp_date, tp_inst.timezone);
15951599
}

0 commit comments

Comments
 (0)