From: Romeo Vegvari Date: Tue, 1 Apr 2014 09:39:38 +0000 (+0100) Subject: hungarian language, meridiem added X-Git-Tag: 2.6.0~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1571%2Fhead;p=thirdparty%2Fmoment.git hungarian language, meridiem added --- diff --git a/lang/hu.js b/lang/hu.js index 4d84ebdf6..9833024cd 100644 --- a/lang/hu.js +++ b/lang/hu.js @@ -62,6 +62,13 @@ LLL : "YYYY. MMMM D., LT", LLLL : "YYYY. MMMM D., dddd LT" }, + meridiem : function (hours, minutes, isLower) { + if (hours < 12) { + return isLower === true ? 'de' : 'DE'; + } else { + return isLower === true ? 'du' : 'DU'; + } + }, calendar : { sameDay : '[ma] LT[-kor]', nextDay : '[holnap] LT[-kor]', diff --git a/test/lang/hu.js b/test/lang/hu.js index 192966b29..1313edaf6 100644 --- a/test/lang/hu.js +++ b/test/lang/hu.js @@ -70,6 +70,22 @@ exports["lang:hu"] = { test.done(); }, + "meridiem" : function (test) { + test.expect(8); + + test.equal(moment([2011, 2, 23, 0, 0]).format('a'), "de", "am"); + test.equal(moment([2011, 2, 23, 11, 59]).format('a'), "de", "am"); + test.equal(moment([2011, 2, 23, 12, 0]).format('a'), "du", "pm"); + test.equal(moment([2011, 2, 23, 23, 59]).format('a'), "du", "pm"); + + test.equal(moment([2011, 2, 23, 0, 0]).format('A'), "DE", "AM"); + test.equal(moment([2011, 2, 23, 11, 59]).format('A'), "DE", "AM"); + test.equal(moment([2011, 2, 23, 12, 0]).format('A'), "DU", "PM"); + test.equal(moment([2011, 2, 23, 23, 59]).format('A'), "DU", "PM"); + + test.done(); + }, + "format ordinal" : function (test) { test.expect(31); @@ -353,12 +369,12 @@ exports["lang:hu"] = { test.done(); }, - + "returns the name of the language" : function (test) { if (typeof module !== 'undefined' && module.exports) { test.equal(require('../../lang/hu'), 'hu', "module should export hu"); } - + test.done(); } };