Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Add localeSort param to Locale weekday methods #4553

Merged
merged 2 commits into from Jan 21, 2019

Conversation

marwahaha
Copy link
Member

fixes #4066

This adds Locale#weekdays(true) to sort weekdays by locale (as moment.weekdays(true) does if it is the current locale). Same for #weekdaysShort, #weekdaysMin.

I added some tests for all locales, and a concrete one for en-au.
Example:

moment.localeData('en-gb').weekdays(true) 

@coveralls
Copy link

coveralls commented Apr 13, 2018

Coverage Status

Coverage increased (+0.03%) to 94.65% when pulling aaf2381 on km/locale-sort-weekdays into 10013b1 on develop.

@marwahaha marwahaha requested a review from icambron April 16, 2018 00:08
@@ -35,6 +35,9 @@ function weekdaysCaseReplace(m, format) {
'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
};

if (m === true) {
return weekdays['nominative'].slice(1, 7).concat(weekdays['nominative'].slice(0, 1));
}
if (!m) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Week Days locale problems
3 participants