In accordance with MediaWiki's date formatting routines.
For now, we continue not handling configuration options or user
preferences in this code, although might be a good idea at some point.
I prefer to keep this patch as simple as possible.
Change-Id: I3f490e4bf6b573b5797e00316ec1e648f611765e
/* Moment.js */
'moment' => array(
- 'scripts' => 'resources/lib/moment/moment.js',
+ 'scripts' => array(
+ 'resources/lib/moment/moment.js',
+ 'resources/src/moment-local-dmy.js',
+ ),
'languageScripts' => array(
'af' => 'resources/lib/moment/locale/af.js',
'ar' => 'resources/lib/moment/locale/ar.js',
--- /dev/null
+// 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 */
+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'
+ }
+} );