Skip to content

Commit 76b88b1

Browse files
authored
fix: Replace some deprecated jQuery with recommended replacements (ietf-tools#4607)
1 parent cf03335 commit 76b88b1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

ietf/static/js/datepicker.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
replace: function(new_array){
6262
if (!new_array)
6363
return;
64-
if (!$.isArray(new_array))
64+
if (!Array.isArray(new_array))
6565
new_array = [new_array];
6666
this.clear();
6767
this.push.apply(this, new_array);
@@ -176,7 +176,7 @@
176176
},
177177

178178
_resolveDaysOfWeek: function(daysOfWeek){
179-
if (!$.isArray(daysOfWeek))
179+
if (!Array.isArray(daysOfWeek))
180180
daysOfWeek = daysOfWeek.split(/[,\s]*/);
181181
return $.map(daysOfWeek, Number);
182182
},
@@ -263,7 +263,7 @@
263263
o.daysOfWeekHighlighted = this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]);
264264

265265
o.datesDisabled = o.datesDisabled||[];
266-
if (!$.isArray(o.datesDisabled)) {
266+
if (!Array.isArray(o.datesDisabled)) {
267267
o.datesDisabled = o.datesDisabled.split(',');
268268
}
269269
o.datesDisabled = $.map(o.datesDisabled, function(d){
@@ -579,15 +579,15 @@
579579
},
580580

581581
setDates: function(){
582-
var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
582+
var args = Array.isArray(arguments[0]) ? arguments[0] : arguments;
583583
this.update.apply(this, args);
584584
this._trigger('changeDate');
585585
this.setValue();
586586
return this;
587587
},
588588

589589
setUTCDates: function(){
590-
var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
590+
var args = Array.isArray(arguments[0]) ? arguments[0] : arguments;
591591
this.setDates.apply(this, $.map(args, this._utc_to_local));
592592
return this;
593593
},
@@ -1039,7 +1039,7 @@
10391039

10401040
//Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2)
10411041
//Fallback to unique function for older jquery versions
1042-
if ($.isFunction($.uniqueSort)) {
1042+
if (typeof $.uniqueSort === "function") {
10431043
clsName = $.uniqueSort(clsName);
10441044
} else {
10451045
clsName = $.unique(clsName);

0 commit comments

Comments
 (0)