]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
use feminine suffix for weeks' ordinals
authorMiquel Sonsona <miquelsonsona@gmail.com>
Mon, 13 Oct 2014 16:58:44 +0000 (18:58 +0200)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 17 Nov 2014 05:33:58 +0000 (21:33 -0800)
locale/ca.js
test/locale/ca.js

index eb6fb5886ecaaea176336e341bf60a79c7ded4b4..f7f676fc63628a10126c7eeda43a334ce119c296 100644 (file)
             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 : {
index 95e845076ca12ba4f4302924e710741c11da4ae3..e37fb041d5cc640fffe6c537b0e6c433b542b075 100644 (file)
@@ -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();
     },