From: Roan Kattouw Date: Thu, 23 Apr 2020 20:08:07 +0000 (-0700) Subject: [locale] hr: Fix month declension in Croation LL, LLL, LLLL formats (#5152) X-Git-Tag: 2.25.0~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=451b506318f46b1ea7f858d5fb2da6439a0cc825;p=thirdparty%2Fmoment.git [locale] hr: Fix month declension in Croation LL, LLL, LLLL formats (#5152) Months should be in the accusative case in these formats, but they are returned in the nominative case. This is because these formats hard-code the dot after the day ("D.") rather than using ordinal notation ("Do"). The regex for detecting accusative case matches "Do" but not "D.". Many other locales have the same problem, with L* formats using "D." where "Do" should be used instead, but none of them have different grammatical forms for months, so nothing breaks for them. Croatian is the only one where "D." causes this bug. Downstream bug report from Wikipedia: https://phabricator.wikimedia.org/T223988 --- diff --git a/src/locale/hr.js b/src/locale/hr.js index 188b8c3a5..4e49b41dd 100644 --- a/src/locale/hr.js +++ b/src/locale/hr.js @@ -81,9 +81,9 @@ export default moment.defineLocale('hr', { LT : 'H:mm', LTS : 'H:mm:ss', L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd, D. MMMM YYYY H:mm' + LL : 'Do MMMM YYYY', + LLL : 'Do MMMM YYYY H:mm', + LLLL : 'dddd, Do MMMM YYYY H:mm' }, calendar : { sameDay : '[danas u] LT', diff --git a/src/test/locale/hr.js b/src/test/locale/hr.js index 66823616c..9d0bca67f 100644 --- a/src/test/locale/hr.js +++ b/src/test/locale/hr.js @@ -39,9 +39,9 @@ test('format', function (assert) { ['[the] DDDo [day of the year]', 'the 45. day of the year'], ['LTS', '15:25:50'], ['L', '14.02.2010'], - ['LL', '14. veljača 2010'], - ['LLL', '14. veljača 2010 15:25'], - ['LLLL', 'nedjelja, 14. veljača 2010 15:25'], + ['LL', '14. veljače 2010'], + ['LLL', '14. veljače 2010 15:25'], + ['LLLL', 'nedjelja, 14. veljače 2010 15:25'], ['l', '14.2.2010'], ['ll', '14. velj. 2010'], ['lll', '14. velj. 2010 15:25'],