X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.widgets.datetime%2FDateTimeFormatter.js;h=a7a3bd3087ff5fa814408d9a1f83538c156b39b5;hb=85ac1b5d7c7ca50a93f2d16639cdde2f46bc133e;hp=1793849368ef342e56c58ae309a9e677a3d9a8b7;hpb=ff70e103def9601f40836cbd9022e1267200510e;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki.widgets.datetime/DateTimeFormatter.js b/resources/src/mediawiki.widgets.datetime/DateTimeFormatter.js index 1793849368..a7a3bd3087 100644 --- a/resources/src/mediawiki.widgets.datetime/DateTimeFormatter.js +++ b/resources/src/mediawiki.widgets.datetime/DateTimeFormatter.js @@ -244,6 +244,8 @@ * - '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.} return.intercalarySize Map from @@ -265,6 +267,7 @@ } spec = { component: null, + calendarComponent: false, editable: false, type: 'static', value: params.slice( 1 ).join( '|' ), @@ -286,6 +289,7 @@ c = params[ 0 ] === '#' ? '' : ':'; return { component: 'zone', + calendarComponent: false, editable: true, type: 'toggleLocal', size: 5 + c.length, @@ -321,6 +325,7 @@ case 'full': spec = { component: 'zone', + calendarComponent: false, editable: true, type: 'toggleLocal', values: params[ 0 ] === 'short' ? this.shortZones : this.fullZones, @@ -407,7 +412,7 @@ 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 ] ) ) {