jalaliday
jalaliday copied to clipboard
Wrong list of months
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!