Skip to content

Commit 50dd6d1

Browse files
committed
Fix usage of _defaults.useLocalTimezone
1 parent e657640 commit 50dd6d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jquery-ui-timepicker-addon.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function Timepicker() {
6969
second: 0,
7070
millisec: 0,
7171
timezone: null,
72+
useLocalTimezone: false,
7273
defaultTimezone: "+0000",
7374
hourMin: 0,
7475
minuteMin: 0,
@@ -112,7 +113,6 @@ $.extend(Timepicker.prototype, {
112113
second: 0,
113114
millisec: 0,
114115
timezone: null,
115-
useLocalTimezone: false,
116116
defaultTimezone: "+0000",
117117
hourMinOriginal: null,
118118
minuteMinOriginal: null,
@@ -458,7 +458,7 @@ $.extend(Timepicker.prototype, {
458458
}
459459
}
460460
this.timezone_select.change(function() {
461-
tp_inst.useLocalTimezone = false;
461+
tp_inst._defaults.useLocalTimezone = false;
462462
tp_inst._onTimeChange();
463463
});
464464

@@ -1072,7 +1072,7 @@ $.datepicker._updateDatepicker = function(inst) {
10721072
if(tp_inst) {
10731073
tp_inst._addTimePicker(inst);
10741074

1075-
if (tp_inst.useLocalTimezone) { //checks daylight saving with the new date.
1075+
if (tp_inst._defaults.useLocalTimezone) { //checks daylight saving with the new date.
10761076
var date = new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay, 12);
10771077
selectLocalTimeZone(tp_inst, date);
10781078
tp_inst._onTimeChange();
@@ -1421,7 +1421,7 @@ var parseDateTimeInternal = function(dateFormat, timeFormat, dateTimeString, dat
14211421
var selectLocalTimeZone = function(tp_inst, date)
14221422
{
14231423
if (tp_inst && tp_inst._defaults.showTimezone && tp_inst.timezone_select) {
1424-
tp_inst.useLocalTimezone = true;
1424+
tp_inst._defaults.useLocalTimezone = true;
14251425
var now = typeof date !== 'undefined' ? date : new Date();
14261426
var tzoffset = now.getTimezoneOffset(); // If +0100, returns -60
14271427
var tzsign = tzoffset > 0 ? '-' : '+';

0 commit comments

Comments
 (0)