jenkins-bot has submitted this change and it was merged.

Change subject: Moment.js: Use DMY date format for English
......................................................................


Moment.js: Use DMY date format for English

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
---
M resources/Resources.php
A resources/src/moment-local-dmy.js
2 files changed, 20 insertions(+), 1 deletion(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/Resources.php b/resources/Resources.php
index c54a120..fb0971e 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -733,7 +733,10 @@
        /* 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',
diff --git a/resources/src/moment-local-dmy.js 
b/resources/src/moment-local-dmy.js
new file mode 100644
index 0000000..c67b93e
--- /dev/null
+++ b/resources/src/moment-local-dmy.js
@@ -0,0 +1,16 @@
+// 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'
+       }
+} );

-- 
To view, visit https://gerrit.wikimedia.org/r/226972
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3f490e4bf6b573b5797e00316ec1e648f611765e
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Edokter <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Quiddity <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to