]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Adds comma between day-of-month and year for en-US locale.
authorJon Zeppieri <zeppieri@gmail.com>
Sat, 19 Jul 2014 00:42:35 +0000 (20:42 -0400)
committerIskren Chernev <iskren.chernev@gmail.com>
Fri, 25 Jul 2014 06:16:26 +0000 (23:16 -0700)
Specifically:
- LL   => 'MMMM D, YYYY'
- LLL  => 'MMMM D, YYYY LT'
- LLLL => ''dddd, MMMM D, YYYY LT'

... and similarly for the lowercase variants.

The use of a comma between the day-of-month and year is standard
practice in US English. See:
- ICU docs [http://demo.icu-project.org/icu-bin/locexp?_=en_US]
  (under Date & Time Patterns)
- Chicago Manual of Style (by way of the Library of Congress)
  [http://lcweb2.loc.gov/ammem/ndlpedit/handbook/numberdate.html]
- Wikipedia [http://en.wikipedia.org/wiki/Date_and_time_notation_in_the_United_States]

moment.js
test/locale/en.js
test/moment/create.js
test/moment/format.js

index 8d6c6ddac6b392fa14cd2f3a44f4fb35e6e9ad65..79b1e8b1ca56fe179d99e624dabcb905138d633d 100644 (file)
--- a/moment.js
+++ b/moment.js
         _longDateFormat : {
             LT : 'h:mm A',
             L : 'MM/DD/YYYY',
-            LL : 'MMMM D YYYY',
-            LLL : 'MMMM D YYYY LT',
-            LLLL : 'dddd, MMMM D YYYY LT'
+            LL : 'MMMM D, YYYY',
+            LLL : 'MMMM D, YYYY LT',
+            LLLL : 'dddd, MMMM D, YYYY LT'
         },
         longDateFormat : function (key) {
             var output = this._longDateFormat[key];
index 71a5b20ecb548790030ee037f5a8c1850ccd2a18..a546602561dba261998f0ce770b68a5ca28c4566 100644 (file)
@@ -59,13 +59,13 @@ exports["locale:en"] = {
                 ['a A',                                'pm PM'],
                 ['[the] DDDo [day of the year]',       'the 45th day of the year'],
                 ['L',                                  '02/14/2010'],
-                ['LL',                                 'February 14 2010'],
-                ['LLL',                                'February 14 2010 3:25 PM'],
-                ['LLLL',                               'Sunday, February 14 2010 3:25 PM'],
+                ['LL',                                 'February 14, 2010'],
+                ['LLL',                                'February 14, 2010 3:25 PM'],
+                ['LLLL',                               'Sunday, February 14, 2010 3:25 PM'],
                 ['l',                                  '2/14/2010'],
-                ['ll',                                 'Feb 14 2010'],
-                ['lll',                                'Feb 14 2010 3:25 PM'],
-                ['llll',                               'Sun, Feb 14 2010 3:25 PM']
+                ['ll',                                 'Feb 14, 2010'],
+                ['lll',                                'Feb 14, 2010 3:25 PM'],
+                ['llll',                               'Sun, Feb 14, 2010 3:25 PM']
             ],
             b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
             i;
index c8f473d31d36cd4c84c7d4b55add4e8dcab0b88b..a10a8a357d67d6c33ab53268d6decc55cc16966e 100644 (file)
@@ -251,12 +251,12 @@ exports.create = {
                 ['LT',                  '12:30 AM'],
                 ['L',                   '09/02/1999'],
                 ['l',                   '9/2/1999'],
-                ['LL',                  'September 2 1999'],
-                ['ll',                  'Sep 2 1999'],
-                ['LLL',                 'September 2 1999 12:30 AM'],
-                ['lll',                 'Sep 2 1999 12:30 AM'],
-                ['LLLL',                'Thursday, September 2 1999 12:30 AM'],
-                ['llll',                'Thu, Sep 2 1999 12:30 AM']
+                ['LL',                  'September 2, 1999'],
+                ['ll',                  'Sep 2, 1999'],
+                ['LLL',                 'September 2, 1999 12:30 AM'],
+                ['lll',                 'Sep 2, 1999 12:30 AM'],
+                ['LLLL',                'Thursday, September 2, 1999 12:30 AM'],
+                ['llll',                'Thu, Sep 2, 1999 12:30 AM']
             ],
             m,
             i;
index e6b5c83bc4311f3265b484d76d76f62703fab243..302155bcbb599b687857a3e2b5b0c3555c81d59c 100644 (file)
@@ -30,7 +30,7 @@ exports.format = {
         test.equal(b.format('[Last]'), 'Last', 'localized tokens');
         test.equal(b.format('[L] L'), 'L 02/14/2009', 'localized tokens with escaped localized tokens');
         test.equal(b.format('[L LL LLL LLLL aLa]'), 'L LL LLL LLLL aLa', 'localized tokens with escaped localized tokens');
-        test.equal(b.format('[LLL] LLL'), 'LLL February 14 2009 3:25 PM', 'localized tokens with escaped localized tokens (recursion)');
+        test.equal(b.format('[LLL] LLL'), 'LLL February 14, 2009 3:25 PM', 'localized tokens with escaped localized tokens (recursion)');
         test.equal(b.format('YYYY[\n]DD[\n]'), '2009\n14\n', 'Newlines');
         test.done();
     },