From 86d309cddc078f0267ca8a3fdc0e9ee153049c59 Mon Sep 17 00:00:00 2001 From: Romeo Vegvari Date: Tue, 1 Apr 2014 10:39:38 +0100 Subject: [PATCH] hungarian language, meridiem added --- lang/hu.js | 7 +++++++ test/lang/hu.js | 20 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) 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(); } }; -- 2.47.2