Merge "Accept BCP 47 codes in LanguageConverter rules"
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets.datetime / DiscordianDateTimeFormatter.js
index fbf3238..6635576 100644 (file)
@@ -1,4 +1,4 @@
-( function ( $, mw ) {
+( function () {
 
        /**
         * Provides various methods needed for formatting dates and times. This
@@ -32,7 +32,7 @@
        /**
         * @inheritdoc
         */
-       mw.widgets.datetime.DiscordianDateTimeFormatter[ 'static' ].formats = {
+       mw.widgets.datetime.DiscordianDateTimeFormatter.static.formats = {
                '@time': '${hour|0}:${minute|0}:${second|0}',
                '@date': '$!{dow|full}${not-intercalary|1|, }${season|full}${not-intercalary|1| }${day|#}, ${year|#}',
                '@datetime': '$!{dow|full}${not-intercalary|1|, }${season|full}${not-intercalary|1| }${day|#}, ${year|#} ${hour|0}:${minute|0}:${second|0} $!{zone|short}',
@@ -67,6 +67,7 @@
                        case 'year|#':
                                spec = {
                                        component: 'Year',
+                                       calendarComponent: true,
                                        type: 'number',
                                        size: 4,
                                        zeropad: false
@@ -76,6 +77,7 @@
                        case 'season|#':
                                spec = {
                                        component: 'Season',
+                                       calendarComponent: true,
                                        type: 'number',
                                        size: 1,
                                        intercalarySize: { 1: 0 },
@@ -86,6 +88,7 @@
                        case 'season|full':
                                spec = {
                                        component: 'Season',
+                                       calendarComponent: true,
                                        type: 'string',
                                        intercalarySize: { 1: 0 },
                                        values: {
                        case 'dow|full':
                                spec = {
                                        component: 'DOW',
+                                       calendarComponent: true,
                                        editable: false,
                                        type: 'string',
                                        intercalarySize: { 1: 0 },
                        case 'day|0':
                                spec = {
                                        component: 'Day',
+                                       calendarComponent: true,
                                        type: 'string',
                                        size: 2,
                                        intercalarySize: { 1: 13 },
                        case 'second|0':
                                spec = {
                                        component: tag.charAt( 0 ).toUpperCase() + tag.slice( 1 ),
+                                       calendarComponent: false,
                                        type: 'number',
                                        size: 2,
                                        zeropad: params[ 0 ] === '0'
                        case 'millisecond|0':
                                spec = {
                                        component: 'Millisecond',
+                                       calendarComponent: false,
                                        type: 'number',
                                        size: 3,
                                        zeropad: params[ 0 ] === '0'
                        }
                        if ( spec.values ) {
                                spec.size = Math.max.apply(
+                                       // eslint-disable-next-line jquery/no-map-util
                                        null, $.map( spec.values, function ( v ) { return v.length; } )
                                );
                        }
                return ret;
        };
 
-}( jQuery, mediaWiki ) );
+}() );