]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Added Hebrew dual form for hours, days, months and years
authorTal Ater <tal@talater.com>
Wed, 14 Aug 2013 22:47:34 +0000 (01:47 +0300)
committerTal Ater <tal@talater.com>
Wed, 14 Aug 2013 22:47:34 +0000 (01:47 +0300)
lang/he.js
test/lang/he.js

index 5495f40956ce021f75ba3e24c3afe30b38baff45..9b357acfb6ca8bb9171515fc166fa021bf99b605 100644 (file)
@@ -35,12 +35,32 @@ require('../moment').lang('he', {
         m : "דקה",
         mm : "%d דקות",
         h : "שעה",
-        hh : "%d שעות",
+        hh : function (number) {
+            if (number === 2) {
+                return "שעתיים";
+            }
+            return number+" שעות";
+        },
         d : "יום",
-        dd : "%d ימים",
+        dd : function (number) {
+            if (number === 2) {
+                return "יומיים";
+            }
+            return number+" ימים";
+        },
         M : "חודש",
-        MM : "%d חודשים",
+        MM : function (number) {
+            if (number === 2) {
+                return "חודשיים";
+            }
+            return number+" חודשים";
+        },
         y : "שנה",
-        yy : "%d שנים"
+        yy : function (number) {
+            if (number === 2) {
+                return "שנתיים";
+            }
+            return number+" שנים";
+        }
     }
 });
index b35a10ba775e185c37c93d0c978f5ebd9cee4ad6..140d8562815dbadf709d03392a40adbe24437e26 100644 (file)
@@ -100,27 +100,27 @@ exports["lang:he"] = {
         test.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true),  "44 דקות",    "44 minutes = 44 minutes");
         test.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true),  "שעה",       "45 minutes = an hour");
         test.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true),  "שעה",       "89 minutes = an hour");
-        test.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  "2 שעות",       "90 minutes = 2 hours");
+        test.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true),  "שעתיים",       "90 minutes = 2 hours");
         test.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true),   "5 שעות",       "5 hours = 5 hours");
         test.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true),  "21 שעות",      "21 hours = 21 hours");
         test.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true),  "יום",         "22 hours = a day");
         test.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true),  "יום",         "35 hours = a day");
-        test.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  "2 ימים",        "36 hours = 2 days");
+        test.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true),  "יומיים",        "36 hours = 2 days");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true),   "יום",         "1 day = a day");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true),   "5 ימים",        "5 days = 5 days");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true),  "25 ימים",       "25 days = 25 days");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true),  "חודש",       "26 days = a month");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true),  "חודש",       "30 days = a month");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 45}), true),  "חודש",       "45 days = a month");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  "2 חודשים",      "46 days = 2 months");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  "2 חודשים",      "75 days = 2 months");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true),  "חודשיים",      "46 days = 2 months");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true),  "חודשיים",      "75 days = 2 months");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true),  "3 חודשים",      "76 days = 3 months");
         test.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true),   "חודש",       "1 month = a month");
         test.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true),   "5 חודשים",      "5 months = 5 months");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 344}), true), "11 חודשים",     "344 days = 11 months");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), "שנה",        "345 days = a year");
         test.equal(start.from(moment([2007, 1, 28]).add({d: 547}), true), "שנה",        "547 days = a year");
-        test.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), "2 שנים",       "548 days = 2 years");
+        test.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), "שנתיים",       "548 days = 2 years");
         test.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true),   "שנה",        "1 year = a year");
         test.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true),   "5 שנים",       "5 years = 5 years");
         test.done();