Skip to content

Commit 40c115a

Browse files
committed
Updated the onChangeMonthYear and onClose callbacks to point the "this" keyword at the associated input per the original jQuery UI Datepicker docs
1 parent ec1a143 commit 40c115a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ $.extend(Timepicker.prototype, {
134134
// Update the time as well : this prevents the time from disappearing from the $input field.
135135
tp_inst._updateDateTime(dp_inst);
136136
if ($.isFunction(o.onChangeMonthYear))
137-
o.onChangeMonthYear(year, month, dp_inst, tp_inst);
137+
o.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
138138
},
139139
onClose: function(dateText, dp_inst) {
140140
if (tp_inst.timeDefined === true && $input.val() != '')
141141
tp_inst._updateDateTime(dp_inst);
142142
if ($.isFunction(o.onClose))
143-
o.onClose(dateText, dp_inst, tp_inst);
143+
o.onClose.call($input[0], dateText, dp_inst, tp_inst);
144144
},
145145
timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
146146
});

0 commit comments

Comments
 (0)