Skip to content

Commit

Permalink
[locale] Fix wrong calendar() output in 'be' localisation (#4528)
Browse files Browse the repository at this point in the history
* Fix wrong calendar() output in 'be' localisation

* Add one specific belarusian letter

* Add a test

* Fix linter errors
  • Loading branch information
mikitasolo authored and marwahaha committed Apr 24, 2018
1 parent aba77ec commit 508f9ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/locale/be.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default moment.defineLocale('be', {
weekdays : {
format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),
standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/
isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/
},
weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
Expand Down
3 changes: 3 additions & 0 deletions src/test/locale/be.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

0 comments on commit 508f9ce

Please sign in to comment.