Skip to content

Commit

Permalink
Adds comma between day-of-month and year for en-US locale.
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
97jaz authored and ichernev committed Jul 25, 2014
1 parent ec5c9d2 commit 19974bc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions moment.js
Expand Up @@ -837,9 +837,9 @@
_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];
Expand Down
12 changes: 6 additions & 6 deletions test/locale/en.js
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions test/moment/create.js
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/moment/format.js
Expand Up @@ -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();
},
Expand Down

0 comments on commit 19974bc

Please sign in to comment.