X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmoment-locale-overrides.js;h=dd33b007f67b8e60513d0dfb24948644af2aa64f;hb=5be717eb6e11a2abf0214c156215d32f87a46af4;hp=d49fcdcb68ba683e93d2b18133bde57047aa49cc;hpb=c3294b2d7142987c0ae93ce71737fdb02550e28e;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/moment-locale-overrides.js b/resources/src/moment-locale-overrides.js index d49fcdcb68..dd33b007f6 100644 --- a/resources/src/moment-locale-overrides.js +++ b/resources/src/moment-locale-overrides.js @@ -1,19 +1,4 @@ -// Use DMY date format for Moment.js, in accordance with MediaWiki's date formatting routines. -// This affects English only (and languages without localisations, that fall back to English). -// http://momentjs.com/docs/#/customization/long-date-formats/ /*global moment, mw */ -moment.locale( 'en', { - longDateFormat: { - // Unchanged, but have to be repeated here: - LT: 'h:mm A', - LTS: 'h:mm:ss A', - // Customized: - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY LT', - LLLL: 'dddd, D MMMM YYYY LT' - } -} ); // HACK: Overwrite moment's i18n with MediaWiki's for the current language so that // wgTranslateNumerals is respected. @@ -42,7 +27,7 @@ moment.locale( moment.locale(), { if ( mw.config.get( 'wgTranslateNumerals' ) ) { for ( i = 0; i < 10; i++ ) { if ( table[ i ] !== undefined ) { - s = s.replace( new RegExp( mw.RegExp.escape( i ), 'g' ), table[ i ] ); + s = s.replace( new RegExp( i, 'g' ), table[ i ] ); } } }