Merge "mw.htmlform: Fix hiding of the textbox for 'selectorother' fields on page...
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets.datetime / DateTimeFormatter.js
index 1793849..a7a3bd3 100644 (file)
         *  - 'boolean': The field is a boolean.
         *  - 'toggleLocal': The field represents {@link #getLocal this.getLocal()}.
         *    Editing should directly call {@link #toggleLocal this.toggleLocal()}.
+        * @return {boolean} return.calendarComponent Whether this field is part of a calendar, e.g.
+        *  part of the date instead of the time.
         * @return {number} return.size Maximum number of characters in the field (when
         *  the 'intercalary' component is falsey). If 0, the field should be hidden entirely.
         * @return {Object.<string,number>} return.intercalarySize Map from
                                }
                                spec = {
                                        component: null,
+                                       calendarComponent: false,
                                        editable: false,
                                        type: 'static',
                                        value: params.slice( 1 ).join( '|' ),
                                                c = params[ 0 ] === '#' ? '' : ':';
                                                return {
                                                        component: 'zone',
+                                                       calendarComponent: false,
                                                        editable: true,
                                                        type: 'toggleLocal',
                                                        size: 5 + c.length,
                                        case 'full':
                                                spec = {
                                                        component: 'zone',
+                                                       calendarComponent: false,
                                                        editable: true,
                                                        type: 'toggleLocal',
                                                        values: params[ 0 ] === 'short' ? this.shortZones : this.fullZones,
                if ( v.normalize ) {
                        v = v.normalize();
                }
-               re = new RegExp( '^\\s*' + v.replace( /([\\{}()|.?*+\-\^$\[\]])/g, '\\$1' ), 'i' );
+               re = new RegExp( '^\\s*' + v.replace( /([\\{}()|.?*+\-^$\[\]])/g, '\\$1' ), 'i' ); // eslint-disable-line no-useless-escape
                for ( k in this.values ) {
                        k = +k;
                        if ( !isNaN( k ) && re.test( this.values[ k ] ) ) {