From 40c115af9d5a0577328ffa48a11a9f1e9301179d Mon Sep 17 00:00:00 2001 From: janhartigan Date: Mon, 7 Mar 2011 15:12:06 -0800 Subject: [PATCH] Updated the onChangeMonthYear and onClose callbacks to point the "this" keyword at the associated input per the original jQuery UI Datepicker docs --- jquery-ui-timepicker-addon.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 85c795c..c76924c 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -134,13 +134,13 @@ $.extend(Timepicker.prototype, { // Update the time as well : this prevents the time from disappearing from the $input field. tp_inst._updateDateTime(dp_inst); if ($.isFunction(o.onChangeMonthYear)) - o.onChangeMonthYear(year, month, dp_inst, tp_inst); + o.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst); }, onClose: function(dateText, dp_inst) { if (tp_inst.timeDefined === true && $input.val() != '') tp_inst._updateDateTime(dp_inst); if ($.isFunction(o.onClose)) - o.onClose(dateText, dp_inst, tp_inst); + o.onClose.call($input[0], dateText, dp_inst, tp_inst); }, timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); });