From d164f48cfec65b3377123493db0c045f00de3ea7 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Fri, 12 Sep 2025 09:56:11 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03817=20-=20Audit=20and=20fix=20calls=20t?= =?UTF-8?q?o=20deprecated=20jQuery=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/jquery-ui-timepicker-addon.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/js/jquery-ui-timepicker-addon.js b/js/jquery-ui-timepicker-addon.js index 9def4816e..6b41c7c04 100644 --- a/js/jquery-ui-timepicker-addon.js +++ b/js/jquery-ui-timepicker-addon.js @@ -187,14 +187,14 @@ overrides = { beforeShow: function (input, dp_inst) { - if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) { + if (typeof tp_inst._defaults.evnts.beforeShow === 'function') { return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst); } }, onChangeMonthYear: function (year, month, dp_inst) { // Update the time as well : this prevents the time from disappearing from the $input field. // tp_inst._updateDateTime(dp_inst); - if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) { + if (typeof tp_inst._defaults.evnts.onChangeMonthYear === 'function') { tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst); } }, @@ -202,7 +202,7 @@ if (tp_inst.timeDefined === true && $input.val() !== '') { tp_inst._updateDateTime(dp_inst); } - if ($.isFunction(tp_inst._defaults.evnts.onClose)) { + if (typeof tp_inst._defaults.evnts.onClose === 'function') { tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst); } } @@ -304,7 +304,7 @@ if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) { tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime()); } - tp_inst.$input.bind('focus', function () { + tp_inst.$input.on('focus', function () { tp_inst._onFocus(); }); @@ -315,7 +315,7 @@ * add our sliders to the calendar */ _addTimePicker: function (dp_inst) { - var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val()); + var currDT = ((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val()).trim(); this.timeDefined = this._parseTime(currDT); this._limitMinMaxDateTime(dp_inst, false); @@ -362,7 +362,7 @@ */ _afterInject: function() { var o = this.inst.settings; - if ($.isFunction(o.afterInject)) { + if (typeof o.afterInject === 'function') { o.afterInject.call(this); } }, @@ -509,7 +509,7 @@ selectLocalTimezone(tp_inst); } } - this.timezone_select.change(function () { + this.timezone_select.on('change',function () { tp_inst._onTimeChange(); tp_inst._onSelectHandler(); tp_inst._afterInject(); @@ -525,7 +525,7 @@ } this.$timeObj = $tp.find('.ui_tpicker_time_input'); - this.$timeObj.change(function () { + this.$timeObj.on('change',function () { var timeFormat = tp_inst.inst.settings.timeFormat; var parsedTime = $.datepicker.parseTime(timeFormat, this.value); var update = new Date(); @@ -1077,7 +1077,7 @@ for (var i = min; i <= max; i += step) { sel += '