]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[locale] Fix wrong calendar() output in 'be' localisation (#4528)
authorSobakaSlava <nikita_solo_11@mail.ru>
Tue, 24 Apr 2018 23:54:54 +0000 (02:54 +0300)
committerKunal Marwaha <marwahaha@berkeley.edu>
Tue, 24 Apr 2018 23:54:54 +0000 (15:54 -0800)
* Fix wrong calendar() output in 'be' localisation

* Add one specific belarusian letter

* Add a test

* Fix linter errors

src/locale/be.js
src/test/locale/be.js

index 5e92707d042f10a6a448fb38febdb3841df7c060..e106f241c1666977276ef8742163bad1daa1b1ed 100644 (file)
@@ -39,7 +39,7 @@ export default moment.defineLocale('be', {
     weekdays : {
         format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),
         standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
-        isFormat: /\[ ?[Ð\92в] ?(?:мінулую|наступную)? ?\] ?dddd/
+        isFormat: /\[ ?[УÑ\83Ñ\9e] ?(?:мінулую|наступную)? ?\] ?dddd/
     },
     weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
     weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
index 45635692b21c2cbc8121cf68b38a572dee2f9c4f..5ba85d6ebd7956cabfb7e4d919220b5846ef0192 100644 (file)
@@ -264,3 +264,6 @@ test('weeks year starting sunday formatted', function (assert) {
     assert.equal(moment([2012,  0,  9]).format('w ww wo'), '3 03 3-і', 'Jan  9 2012 should be week 3');
 });
 
+test('calendar should format', function (assert) {
+    assert.equal(moment('2018-04-13').calendar(moment('2018-04-16')), 'У мінулую пятніцу ў 00:00', 'calendar should handle day of week');
+});