Skip to content

Commit 4378827

Browse files
committed
Use defaultTimezone, when a time is already set.
* New config field 'defaulTimezone'.
1 parent d28b5db commit 4378827

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
@@ -69,6 +69,7 @@ function Timepicker() {
6969
second: 0,
7070
millisec: 0,
7171
timezone: null,
72+
defaultTimezone: "+0000",
7273
hourMin: 0,
7374
minuteMin: 0,
7475
secondMin: 0,
@@ -111,6 +112,7 @@ $.extend(Timepicker.prototype, {
111112
second: 0,
112113
millisec: 0,
113114
timezone: null,
115+
defaultTimezone: "+0000",
114116
hourMinOriginal: null,
115117
minuteMinOriginal: null,
116118
secondMinOriginal: null,
@@ -448,7 +450,11 @@ $.extend(Timepicker.prototype, {
448450
if (typeof this.timezone != "undefined" && this.timezone != null && this.timezone != "") {
449451
this.timezone_select.val(this.timezone);
450452
} else {
451-
selectLocalTimeZone(tp_inst);
453+
if (typeof this.hour != "undefined" && this.hour != null && this.hour != "") {
454+
this.timezone_select.val(o.defaultTimezone);
455+
} else {
456+
selectLocalTimeZone(tp_inst);
457+
}
452458
}
453459
this.timezone_select.change(function() {
454460
tp_inst._onTimeChange();

0 commit comments

Comments
 (0)