]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
adding changes for #484 to support ordinals without numbers 577/head
authorTim Wood <washwithcare@gmail.com>
Mon, 14 Jan 2013 19:21:57 +0000 (11:21 -0800)
committerTim Wood <washwithcare@gmail.com>
Mon, 14 Jan 2013 19:21:57 +0000 (11:21 -0800)
45 files changed:
lang/ar-ma.js
lang/ar.js
lang/bg.js
lang/ca.js
lang/cs.js
lang/cv.js
lang/da.js
lang/de.js
lang/en-ca.js
lang/en-gb.js
lang/eo.js
lang/es.js
lang/et.js
lang/eu.js
lang/fi.js
lang/fr-ca.js
lang/fr.js
lang/gl.js
lang/he.js
lang/hu.js
lang/id.js
lang/is.js
lang/it.js
lang/ja.js
lang/jp.js
lang/ko.js
lang/kr.js
lang/lv.js
lang/nb.js
lang/ne.js
lang/nl.js
lang/pl.js
lang/pt-br.js
lang/pt.js
lang/ro.js
lang/ru.js
lang/sl.js
lang/sv.js
lang/th.js
lang/tr.js
lang/tzm-la.js
lang/tzm.js
lang/zh-cn.js
lang/zh-tw.js
moment.js

index 71868a9b6813de32c15790d04fc0fcbef454f4d9..bdb472c21a334b401716067cc1c83f2016162058 100644 (file)
@@ -39,9 +39,6 @@ require('../moment').lang('ar-ma', {
         y : "سنة",
         yy : "%d سنوات"
     },
-    ordinal : function (number) {
-        return '';
-    },
     week : {
         dow : 6, // Saturday is the first day of the week.
         doy : 12  // The week that contains Jan 1st is the first week of the year.
index 0b916fe947d4a790f082a53e5a960e56a5a34e1c..cfa420acd6994b8f25da2064a1a7a1433de1fb14 100644 (file)
@@ -38,9 +38,6 @@ require('../moment').lang('ar', {
         y : "سنة",
         yy : "%d سنوات"
     },
-    ordinal : function (number) {
-        return '';
-    },
     week : {
         dow : 6, // Saturday is the first day of the week.
         doy : 12  // The week that contains Jan 1st is the first week of the year.
index d94de6e50a1bb184df0450fb1573fc51378eb11e..c5b47851e24886d33e43001574ee702037838e66 100644 (file)
@@ -54,19 +54,19 @@ require('../moment').lang('bg', {
         var lastDigit = number % 10,
             last2Digits = number % 100;
         if (number === 0) {
-            return '-ев';
+            return number + '-ев';
         } else if (last2Digits === 0) {
-            return '-ен';
+            return number + '-ен';
         } else if (last2Digits > 10 && last2Digits < 20) {
-            return '-ти';
+            return number + '-ти';
         } else if (lastDigit === 1) {
-            return '-ви';
+            return number + '-ви';
         } else if (lastDigit === 2) {
-            return '-ри';
+            return number + '-ри';
         } else if (lastDigit === 7 || lastDigit === 8) {
-            return '-ми';
+            return number + '-ми';
         } else {
-            return '-ти';
+            return number + '-ти';
         }
     },
     week : {
index e95496d52ab5c8372a79b0b96e0c5aeefa73cd6a..9bbe963571b174605b2ee318f549c2ef2726729e 100644 (file)
@@ -48,9 +48,7 @@ require('../moment').lang('ca', {
         y : "un any",
         yy : "%d anys"
     },
-    ordinal : function (number) {
-        return 'º';
-    },
+    ordinal : '%dº',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index fb3d87a4c5188e64ed1a7dd1267d605995487afa..cb98b2eb324506dd7939899303af4e8e354ed403 100644 (file)
@@ -137,9 +137,7 @@ require('../moment').lang('cs', {
         y : translate,
         yy : translate
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index 7ca3f6ab5acaad52a41af68f829247992628e426..802aa2b4dd7a84558287dcbee58d9e0c7b4c610a 100644 (file)
@@ -42,9 +42,7 @@ require('../moment').lang('cv', {
         y : "пĕр çул",
         yy : "%d çул"
     },
-    ordinal : function (number) {
-        return '-мĕш';
-    },
+    ordinal : '%d-мĕш',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 7  // The week that contains Jan 1st is the first week of the year.
index 4f031672ccae7f963438c161cf9f0741634107a6..4f4141f90de9c469f252f5a1188105a837e3dc60 100644 (file)
@@ -38,9 +38,7 @@ require('../moment').lang('da', {
         y : "år",
         yy : "%d år"
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index 1061f1996026328884b44ba46798355aed2f4d0b..c3a2e47d347ef083f6147c65e6e6bd71c72895c9 100644 (file)
@@ -38,9 +38,7 @@ require('../moment').lang('de', {
         y : "einem Jahr",
         yy : "%d Jahren"
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index c3cf5aa0dc0cdb225f72809ece60df6b8352a720..b432298ad3503bfa3245a422e2e4e70871851f22 100644 (file)
@@ -39,10 +39,11 @@ require('../moment').lang('en-ca', {
         yy : "%d years"
     },
     ordinal : function (number) {
-        var b = number % 10;
-        return (~~ (number % 100 / 10) === 1) ? 'th' :
+        var b = number % 10,
+            output = (~~ (number % 100 / 10) === 1) ? 'th' :
             (b === 1) ? 'st' :
             (b === 2) ? 'nd' :
             (b === 3) ? 'rd' : 'th';
+        return number + output;
     }
 });
index efa722454a76a9ec26fbcdf6fc69bb2403aaa031..98bc95be5428eb807213c89509b348a17ad3a06e 100644 (file)
@@ -39,11 +39,12 @@ require('../moment').lang('en-gb', {
         yy : "%d years"
     },
     ordinal : function (number) {
-        var b = number % 10;
-        return (~~ (number % 100 / 10) === 1) ? 'th' :
+        var b = number % 10,
+            output = (~~ (number % 100 / 10) === 1) ? 'th' :
             (b === 1) ? 'st' :
             (b === 2) ? 'nd' :
             (b === 3) ? 'rd' : 'th';
+        return number + output;
     },
     week : {
         dow : 1, // Monday is the first day of the week.
index 72b91d8c0175ccdebd23fdfc8d9dd60de6c0e283..6637fa29caaee8584ad9e8a27248a8536e7058f2 100644 (file)
@@ -47,9 +47,7 @@ require('../moment').lang('eo', {
         y : "jaro",
         yy : "%d jaroj"
     },
-    ordinal : function (number) {
-        return "a";
-    },
+    ordinal : "%da",
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 7  // The week that contains Jan 1st is the first week of the year.
index eb085fc6cbc5e6771be05bae0e5ec340cca89fd2..f935bd1885f5c292ce8c1204857ba226bf42f25c 100644 (file)
@@ -48,9 +48,7 @@ require('../moment').lang('es', {
         y : "un año",
         yy : "%d años"
     },
-    ordinal : function (number) {
-        return 'º';
-    },
+    ordinal : '%dº',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index 4168fe3d3ea569560b93fa5731756fa8ffb0b36f..5e07802bd9b4d99441b40732e2d471d761f58afa 100644 (file)
@@ -42,9 +42,7 @@ require('../moment').lang('et', {
         y      : "aasta",
         yy     : "%d aastat"
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index 2411ccf9b5dde2a47a3e924f5fb6a2e47ca691e0..414a3417365c5d1d566ade953403427069f5921a 100644 (file)
@@ -38,9 +38,7 @@ require('../moment').lang('eu', {
         y : "urte bat",
         yy : "%d urte"
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 7  // The week that contains Jan 1st is the first week of the year.
index 7b495273a721ba240da23446bcc00b077b679295..ee61c8915c3cf6381dd87448083a2d2c284aeea6 100644 (file)
@@ -81,9 +81,7 @@ require('../moment').lang('fi', {
         y : translate,
         yy : translate
     },
-    ordinal : function (number) {
-        return ".";
-    },
+    ordinal : "%d.",
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index f97da7ac8616953084e5808ca2636373b3b5d3d4..7a7afa63b739e299351cd06b475faea8e6a0ca0d 100644 (file)
@@ -39,6 +39,6 @@ require('../moment').lang('fr-ca', {
         yy : "%d années"
     },
     ordinal : function (number) {
-        return number === 1 ? 'er' : 'ème';
+        return number + (number === 1 ? 'er' : 'ème');
     }
 });
index c87b8db001e7d676ec6ac14c2871d422c7652287..19264f14170fe08151fe959258a034399389107f 100644 (file)
@@ -39,7 +39,7 @@ require('../moment').lang('fr', {
         yy : "%d années"
     },
     ordinal : function (number) {
-        return number === 1 ? 'er' : 'ème';
+        return number + (number === 1 ? 'er' : 'ème');
     },
     week : {
         dow : 1, // Monday is the first day of the week.
index ef8fc7b58170e3ebae118128f5204116788ae10c..10044ffa1d337acf00be7a38e5f5ed3e3523e1c8 100644 (file)
@@ -48,9 +48,7 @@ require('../moment').lang('gl', {
         y : "un ano",
         yy : "%d anos"
     },
-    ordinal : function (number) {
-        return 'º';
-    },
+    ordinal : '%dº',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 7  // The week that contains Jan 1st is the first week of the year.
index ac781d347b1b89ba8edcfd4a2621754606c9fd8d..e9655972989541f336b707f78eb1c80b9eaf92f5 100644 (file)
@@ -38,8 +38,5 @@ require('../moment').lang('he', {
         MM : "%d חודשים",
         y : "שנה",
         yy : "%d שנים"
-    },
-    ordinal : function (number) {
-        return ''; // Function is not required for the Hebrew language.
     }
 });
index 475b0f060d8e3e13f1c5c77a3f94cdfbcfd88965..93750017a8b31a441958be8ae327e71854dd4ba3 100644 (file)
@@ -79,10 +79,7 @@ require('../moment').lang('hu', {
         y : translate,
         yy : translate
     },
-    ordinal : function (number) {
-        return '.';
-
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 7  // The week that contains Jan 1st is the first week of the year.
index f607b55463c617eb9d85af77cf789531af10a0f0..1a27adb89b3988e8e39362aa35d8623b433923ec 100644 (file)
@@ -50,9 +50,6 @@ require('../moment').lang('id', {
         y : "setahun",
         yy : "%d tahun"
     },
-    ordinal : function (number) {
-        return '';
-    },
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 7  // The week that contains Jan 1st is the first week of the year.
index 5b836335325ceb0f8a13f233212912fe7b351cd9..8455e419f90d3d9f1799f18d6a017411b4ae4913 100644 (file)
@@ -106,9 +106,7 @@ require('../moment').lang('is', {
         y : translate,
         yy : translate
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index 851be378255a77b50e5b23b9014f10335bbd621e..3166393fdd28dcfa6f7819902247f6d3b64a6e26 100644 (file)
@@ -38,9 +38,7 @@ require('../moment').lang('it', {
         y : "un anno",
         yy : "%d anni"
     },
-    ordinal: function () {
-        return 'º';
-    },
+    ordinal: '%dº',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index d5100fee2ee97679e1d8fdb5dc9d16ada56c3253..84ce6e85a7c8a41856f4f6662b6dc2a004c1c844 100644 (file)
@@ -44,8 +44,5 @@ require('../moment').lang('ja', {
         MM : "%dヶ月",
         y : "1年",
         yy : "%d年"
-    },
-    ordinal : function (number) {
-        return '';
     }
 });
index 804511bf5d06fbf6aa2d782c745e0d9949d28be9..6857365a81e5b83ce53864c91782d4e2ed4e9426 100644 (file)
@@ -47,8 +47,5 @@ require('../moment').lang('jp', {
         MM : "%dヶ月",
         y : "1年",
         yy : "%d年"
-    },
-    ordinal : function (number) {
-        return '';
     }
 });
index 76b1a93d4c4ac8fd5e65ebb5cefccef50eabe72c..7a59cb783b6f4ddc3763daf362c3a5bb82251c6a 100644 (file)
@@ -42,7 +42,5 @@ require('../moment').lang('ko', {
         y : "일년",
         yy : "%d년"
     },
-    ordinal : function (number) {
-        return '일';
-    }
+    ordinal : '%d일'
 });
index b702ca6b93554fbb0572d78cc513a51c05a7f010..5ea9c0d2afaefbdb7562d5e0022b63c43d015c24 100644 (file)
@@ -45,7 +45,5 @@ require('../moment').lang('kr', {
         y : "일년",
         yy : "%d년"
     },
-    ordinal : function (number) {
-        return '일';
-    }
+    ordinal : '%d일'
 });
index 48bfcb2a19e92f429e3861021bd329872acb80f0..855ebead76fc74c43e76c1a84ca19f9018047d98 100644 (file)
@@ -59,9 +59,7 @@ require('../moment').lang('lv', {
         y : "gadu",
         yy : relativeTimeWithPlural
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index 2cc3ae086294004d2d276f2c52976b784c9fadf7..a39f8f5a91b7876d9df87c0c6d7f7753e451cdc5 100644 (file)
@@ -38,9 +38,7 @@ require('../moment').lang('nb', {
         y : "ett år",
         yy : "%d år"
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index 16c95631d66814f4d0fff58306d1eac3ed1f133f..6df9a9c5a19a3f9aca9676373af94af3942a1c79 100644 (file)
@@ -88,9 +88,6 @@ require('../moment').lang('ne', {
         y : "एक बर्ष",
         yy : "%d बर्ष"
     },
-    ordinal : function (number) {
-        return '';
-    },
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 7  // The week that contains Jan 1st is the first week of the year.
index 4b1480211a03c8a9801225637c76a7016e4fcb44..018990b40de07d54510464dcad434afb57e947e4 100644 (file)
@@ -48,7 +48,7 @@ require('../moment').lang('nl', {
         yy : "%d jaar"
     },
     ordinal : function (number) {
-        return (number === 1 || number === 8 || number >= 20) ? 'ste' : 'de';
+        return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
     },
     week : {
         dow : 1, // Monday is the first day of the week.
index 030ca39a2cc02cdbe53d516e7501621727c2fbff..51e2318720369fe93bebc417537733f3a540cedd 100644 (file)
@@ -71,9 +71,7 @@ require('../moment').lang('pl', {
         y : "rok",
         yy : translate
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index 23600027a951132de7560772d9db33adb8c0228c..2427097e18888f03a87ebd1f05716be54b564d87 100644 (file)
@@ -42,7 +42,5 @@ require('../moment').lang('pt-br', {
         y : "um ano",
         yy : "%d anos"
     },
-    ordinal : function (number) {
-        return 'º';
-    }
+    ordinal : '%dº'
 });
index 594094bfc8a0233ed96a1fcd286e62229cc0c589..b199b8e570b33d64e8a5cc7320a7da37b447774a 100644 (file)
@@ -42,9 +42,7 @@ require('../moment').lang('pt', {
         y : "um ano",
         yy : "%d anos"
     },
-    ordinal : function (number) {
-        return 'º';
-    },
+    ordinal : '%dº',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 4  // The week that contains Jan 4th is the first week of the year.
index ba35c674dab6c62cfb84222a55f133a3de53df46..036c85bafe999b831487600e6605859dbfdaca84 100644 (file)
@@ -39,9 +39,6 @@ require('../moment').lang('ro', {
         y : "un an",
         yy : "%d ani"
     },
-    ordinal : function (number) {
-        return '';
-    },
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 7  // The week that contains Jan 1st is the first week of the year.
index 4be8616b36e865973e6a9babeacbaa2451d5d541..73e169fb09710fb11a134777d99aab58af6db36a 100644 (file)
@@ -116,9 +116,7 @@ require('../moment').lang('ru', {
         y : "год",
         yy : relativeTimeWithPlural
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 7  // The week that contains Jan 1st is the first week of the year.
index 49c83db2d86fe70fda94eab4ab51002cfdc836ac..a284f06a68b4e7deed1d939aa682f867ac1d8b67 100644 (file)
@@ -126,9 +126,7 @@ require('../moment').lang('sl', {
         y      : "eno leto",
         yy     : translate
     },
-    ordinal : function (number) {
-        return '.';
-    },
+    ordinal : '%d.',
     week : {
         dow : 1, // Monday is the first day of the week.
         doy : 7  // The week that contains Jan 1st is the first week of the year.
index 4359f5648e771b66090813bb62b7455607de5126..8b283d3b4cddbf4e378533ae7c3c177668908b78 100644 (file)
@@ -39,11 +39,12 @@ require('../moment').lang('sv', {
         yy : "%d år"
     },
     ordinal : function (number) {
-        var b = number % 10;
-        return (~~ (number % 100 / 10) === 1) ? 'e' :
+        var b = number % 10,
+            output = (~~ (number % 100 / 10) === 1) ? 'e' :
             (b === 1) ? 'a' :
             (b === 2) ? 'a' :
             (b === 3) ? 'e' : 'e';
+        return number + output;
     },
     week : {
         dow : 1, // Monday is the first day of the week.
index a01f7791eba48abdb1a5af64111ee6921cd12ad1..d2699cd6fefa40f3b386f080e196ce735ae6a8c5 100644 (file)
@@ -44,8 +44,5 @@ require('../moment').lang('th', {
         MM : "%d เดือน",
         y : "1 ปี",
         yy : "%d ปี"
-    },
-    ordinal : function (number) {
-        return '';
     }
 });
index 617027e2dc1630bfc56e9191397fda04072ce8f5..731bfffb7f76eb5324093bd734911968622a7ad5 100644 (file)
@@ -67,13 +67,13 @@ require('../moment').lang('tr', {
     },
     ordinal : function (number) {
         if (number === 0) {  // special case for zero
-            return "'ıncı";
+            return number + "'ıncı";
         }
         var a = number % 10,
             b = number % 100 - a,
             c = number >= 100 ? 100 : null;
 
-        return suffixes[a] || suffixes[b] || suffixes[c];
+        return number + (suffixes[a] || suffixes[b] || suffixes[c]);
     },
     week : {
         dow : 1, // Monday is the first day of the week.
index af56946f1f996b090ed790b7b9d78edd6668d892..870947ed57ef5093d3cc9f7a0c732ae3bac2956e 100644 (file)
@@ -38,9 +38,6 @@ require('../moment').lang('tzm-la', {
         y : "asgas",
         yy : "%d isgasn"
     },
-    ordinal : function (number) {
-        return '';
-    },
     week : {
         dow : 6, // Saturday is the first day of the week.
         doy : 12  // The week that contains Jan 1st is the first week of the year.
index 18fb4c5789081406bd35226f390c63e2f7ac8c6d..cffb946c813d63ad23156e5cad4cdf0d39beebfe 100644 (file)
@@ -38,9 +38,6 @@ require('../moment').lang('tzm', {
         y : "ⴰⵙⴳⴰⵙ",
         yy : "%d ⵉⵙⴳⴰⵙⵏ"
     },
-    ordinal : function (number) {
-        return '';
-    },
     week : {
         dow : 6, // Saturday is the first day of the week.
         doy : 12  // The week that contains Jan 1st is the first week of the year.
index 85cd1d609df0f146c362332e3261db866b014523..b322e096970d454de5095b1bd88dad7deee7596c 100644 (file)
@@ -50,8 +50,5 @@ require('../moment').lang('zh-cn', {
         MM : "%d个月",
         y : "1年",
         yy : "%d年"
-    },
-    ordinal : function (number) {
-        return '';
     }
 });
index d9d80d470bff332d51f710fbe877004efddbbeec..e29bd2fdebb7c4a5b793702bea5d43a3a309c7d4 100644 (file)
@@ -50,8 +50,5 @@ require('../moment').lang('zh-tw', {
         MM : "%d個月",
         y : "一年",
         yy : "%d年"
-    },
-    ordinal : function (number) {
-        return '';
     }
 });
index 414fafdd3cccf9a9eafaf79aaaa5e0a5220def53..be3d9ad08ca2994c1cc5821380ffe1eff7abcc5a 100644 (file)
--- a/moment.js
+++ b/moment.js
     }
     function ordinalizeToken(func) {
         return function (a) {
-            var b = func.call(this, a);
-            return b + this.lang().ordinal(b);
+            return this.lang().ordinal(func.call(this, a));
         };
     }
 
         },
 
         ordinal : function (number) {
-            return '';
+            return this._ordinal.replace("%d", number);
         },
+        _ordinal : "%d",
 
         preparse : function (string) {
             return string;
     // Set default language, other languages will inherit from English.
     moment.lang('en', {
         ordinal : function (number) {
-            var b = number % 10;
-            return (~~ (number % 100 / 10) === 1) ? 'th' :
+            var b = number % 10,
+                output = (~~ (number % 100 / 10) === 1) ? 'th' :
                 (b === 1) ? 'st' :
                 (b === 2) ? 'nd' :
                 (b === 3) ? 'rd' : 'th';
+            return number + output;
         }
     });