Skip to content

Commit 33ca84c

Browse files
committed
Fix for default timezone if missing.
1 parent da54680 commit 33ca84c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

example-timezone.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<script type="text/javascript">
2323
$(document).ready(function(){
2424
$(".timepicktest0").datetimepicker({ dateFormat: $.datepicker.RFC_2822, timeFormat: 'hh:mm' });
25-
$(".timepicktest1").datetimepicker({ dateFormat: $.datepicker.RFC_2822, timeFormat: 'hh:mm z', showTimezone: true });
25+
$(".timepicktest1").datetimepicker({ dateFormat: $.datepicker.RFC_2822, timeFormat: 'hh:mm z', showTimezone: true, timezone: "+0100" });
2626
$(".timepicktest2").datetimepicker({ dateFormat: $.datepicker.RFC_2822, timeFormat: 'hh:mm z', showTimezone: true,
2727
timezoneList: [{"value": "+0000", "label": "British Winter Time"}, {"value": "+0100", "label": "British Summer Time"}] });
2828
});

jquery-ui-timepicker-addon.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function Timepicker() {
5454
hour: 0,
5555
minute: 0,
5656
second: 0,
57+
timezone: '+0000',
5758
hourMin: 0,
5859
minuteMin: 0,
5960
secondMin: 0,
@@ -409,7 +410,7 @@ $.extend(Timepicker.prototype, {
409410
.text(typeof val == "object" ? val.label : val);
410411
})
411412
);
412-
this.timezone_select.val(this.timezone);
413+
this.timezone_select.val((typeof this.timezone != "undefined" && this.timezone != null && this.timezone != "") ? this.timezone : o.timezone);
413414
this.timezone_select.change(function() {
414415
tp_inst._onTimeChange();
415416
});

0 commit comments

Comments
 (0)