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

Wrong list of months #39

Open
mokhosh opened this issue Jul 24, 2023 · 0 comments
Open

Wrong list of months #39

mokhosh opened this issue Jul 24, 2023 · 0 comments

Comments

@mokhosh
Copy link

mokhosh commented Jul 24, 2023

Currently what you get out of months() method is dependant on locale which is wrong.
It should depend on calendar, and locale should only define the language:

dayjs.locale('fa')
console.log(dayjs.calendar('jalali').months())
// outputs: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند']
// Correct!
console.log(dayjs.months())
// outputs: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند']
// Wrong! It should be ژانویه فوریه مارچ etc.

dayjs.locale('en')
console.log(dayjs.calendar('jalali').months())
// outputs: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
// Wrong! It should be Farvardin, Ordibehesht, etc.
console.log(dayjs.months())
// outputs: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
// Correct!
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

No branches or pull requests

1 participant