Skip to content

Commit 41e6a18

Browse files
committed
If the timezone of the given date matches the local timezone, use local timezone.
* This switches the timezone automatically, when changing the date to a (non) daylight saving time.
1 parent d6cc2ce commit 41e6a18

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,13 @@ $.extend(Timepicker.prototype, {
449449
})
450450
);
451451
if (typeof this.timezone != "undefined" && this.timezone != null && this.timezone != "") {
452-
this.timezone_select.val(this.timezone);
452+
var local_date = new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12);
453+
var local_timezone = timeZoneString(local_date);
454+
if (local_timezone == this.timezone) {
455+
selectLocalTimeZone(tp_inst);
456+
} else {
457+
this.timezone_select.val(this.timezone);
458+
}
453459
} else {
454460
if (typeof this.hour != "undefined" && this.hour != null && this.hour != "") {
455461
this.timezone_select.val(o.defaultTimezone);

0 commit comments

Comments
 (0)