Fix for default timezone if missing.

This commit is contained in:
Bruno Harbulot 2011-02-28 14:00:20 +00:00
parent da54680397
commit 33ca84c982
2 changed files with 3 additions and 2 deletions

View file

@ -22,7 +22,7 @@ input { width: 200px; }
<script type="text/javascript">
$(document).ready(function(){
$(".timepicktest0").datetimepicker({ dateFormat: $.datepicker.RFC_2822, timeFormat: 'hh:mm' });
$(".timepicktest1").datetimepicker({ dateFormat: $.datepicker.RFC_2822, timeFormat: 'hh:mm z', showTimezone: true });
$(".timepicktest1").datetimepicker({ dateFormat: $.datepicker.RFC_2822, timeFormat: 'hh:mm z', showTimezone: true, timezone: "+0100" });
$(".timepicktest2").datetimepicker({ dateFormat: $.datepicker.RFC_2822, timeFormat: 'hh:mm z', showTimezone: true,
timezoneList: [{"value": "+0000", "label": "British Winter Time"}, {"value": "+0100", "label": "British Summer Time"}] });
});

View file

@ -54,6 +54,7 @@ function Timepicker() {
hour: 0,
minute: 0,
second: 0,
timezone: '+0000',
hourMin: 0,
minuteMin: 0,
secondMin: 0,
@ -409,7 +410,7 @@ $.extend(Timepicker.prototype, {
.text(typeof val == "object" ? val.label : val);
})
);
this.timezone_select.val(this.timezone);
this.timezone_select.val((typeof this.timezone != "undefined" && this.timezone != null && this.timezone != "") ? this.timezone : o.timezone);
this.timezone_select.change(function() {
tp_inst._onTimeChange();
});