From: Miquel Sonsona Date: Mon, 13 Oct 2014 16:58:44 +0000 (+0200) Subject: use feminine suffix for weeks' ordinals X-Git-Tag: 2.8.4~22^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c67bb0e67548030dbd8009fe39cd9453b1fcce0f;p=thirdparty%2Fmoment.git use feminine suffix for weeks' ordinals --- diff --git a/locale/ca.js b/locale/ca.js index eb6fb5886..f7f676fc6 100644 --- a/locale/ca.js +++ b/locale/ca.js @@ -58,12 +58,15 @@ y : 'un any', yy : '%d anys' }, - ordinalParse: /\d{1,2}(r|n|t|è)/, - ordinal : function (number) { + ordinalParse: /\d{1,2}(r|n|t|è|a)/, + ordinal : function (number, period) { var output = (number === 1) ? 'r' : (number === 2) ? 'n' : (number === 3) ? 'r' : (number === 4) ? 't' : 'è'; + if (period === 'w' || period === 'W') { + output = 'a'; + } return number + output; }, week : { diff --git a/test/locale/ca.js b/test/locale/ca.js index 95e845076..e37fb041d 100644 --- a/test/locale/ca.js +++ b/test/locale/ca.js @@ -310,11 +310,11 @@ exports['locale:ca'] = { }, 'weeks year starting sunday formatted' : function (test) { - test.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52è', 'Jan 1 2012 should be week 52'); - test.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1r', 'Jan 2 2012 should be week 1'); - test.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1r', 'Jan 8 2012 should be week 1'); - test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2n', 'Jan 9 2012 should be week 2'); - test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2n', 'Jan 15 2012 should be week 2'); + test.equal(moment([2012, 0, 1]).format('w ww wo'), '52 52 52a', 'Jan 1 2012 should be week 52'); + test.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1a', 'Jan 2 2012 should be week 1'); + test.equal(moment([2012, 0, 8]).format('w ww wo'), '1 01 1a', 'Jan 8 2012 should be week 1'); + test.equal(moment([2012, 0, 9]).format('w ww wo'), '2 02 2a', 'Jan 9 2012 should be week 2'); + test.equal(moment([2012, 0, 15]).format('w ww wo'), '2 02 2a', 'Jan 15 2012 should be week 2'); test.done(); },