From 1a685952f63942a1dcbffda4082ecbcd598feecd Mon Sep 17 00:00:00 2001 From: Christopher Lassen Date: Mon, 12 Oct 2020 12:23:28 +0200 Subject: [PATCH] Trim depreacted fixed --- jquery.datetimepicker.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jquery.datetimepicker.js b/jquery.datetimepicker.js index 5091bd6..018d8a0 100644 --- a/jquery.datetimepicker.js +++ b/jquery.datetimepicker.js @@ -1306,8 +1306,8 @@ var datetimepickerFactory = function ($) { input .off('blur.xdsoft') .on('blur.xdsoft', function () { - if (options.allowBlank && (!$.trim($(this).val()).length || - (typeof options.mask === "string" && $.trim($(this).val()) === options.mask.replace(/[0-9]/g, '_')))) { + if (options.allowBlank && (!$(this).val().trim().length || + (typeof options.mask === "string" && $(this).val().trim() === options.mask.replace(/[0-9]/g, '_')))) { $(this).val(null); datetimepicker.data('xdsoft_datetime').empty(); } else { @@ -2441,7 +2441,7 @@ var datetimepickerFactory = function ($) { if (isValidValue(options.mask, val)) { this.value = val; setCaretPos(this, pos); - } else if ($.trim(val) === '') { + } else if (val.trim() === '') { this.value = options.mask.replace(/[0-9]/g, '_'); } else { input.trigger('error_input.xdsoft'); @@ -2521,7 +2521,7 @@ var datetimepickerFactory = function ($) { val = valueBeforeCursor + insertChar + valueAfterNextChar } - if ($.trim(val) === '') { + if (val.trim() === '') { // if empty, set to default val = defaultBlank } else { @@ -2542,7 +2542,7 @@ var datetimepickerFactory = function ($) { if (isValidValue(options.mask, val)) { this.value = val; setCaretPos(this, pos); - } else if ($.trim(val) === '') { + } else if (val.trim() === '') { this.value = options.mask.replace(/[0-9]/g, '_'); } else { input.trigger('error_input.xdsoft');