Use native ES5 Array prototype methods instead of jQuery
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets.datetime / CalendarWidget.js
index 31b1cd5..fa05991 100644 (file)
                return this.selected;
        };
 
+       // eslint-disable-next-line valid-jsdoc
        /**
         * Set the selected dates
         *
                if ( dates instanceof Date ) {
                        dates = [ dates ];
                } else if ( Array.isArray( dates ) ) {
-                       dates = $.grep( dates, function ( dt ) { return dt instanceof Date; } );
+                       dates = dates.filter( function ( dt ) { return dt instanceof Date; } );
                        dates.sort();
                } else {
                        dates = [];
                return this.focusedDate;
        };
 
+       // eslint-disable-next-line valid-jsdoc
        /**
         * Set the currently-focused date
         *
         *
         * @protected
         * @param {jQuery.Event} e Key down event
+        * @return {boolean} False to cancel the default event
         */
        mw.widgets.datetime.CalendarWidget.prototype.onKeyDown = function ( e ) {
                var focusedDate = this.getFocusedDate();