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

اشکال در تنظیم ماه #28

Open
masoudelahi opened this issue Oct 29, 2020 · 1 comment
Open

اشکال در تنظیم ماه #28

masoudelahi opened this issue Oct 29, 2020 · 1 comment

Comments

@masoudelahi
Copy link

وقتی ماه رو تنظیم میکنم برای ماه 12 دچار اشکال میشه.
`
dayjs().calendar('jalali').locale('fa').month(11).format('MMMM'); // فروردین
dayjs().calendar('jalali').locale('fa').month(0).format('MMMM'); // فروردین

dayjs().calendar('jalali').locale('fa').date(1).month(11).format('MMMM'); // اسفند
`

@masoudelahi
Copy link
Author

masoudelahi commented Oct 29, 2020

فعلا مجبور شدم به صورت زیر حلش کنم

setMonth(month) {
    let newDate = this.today.set('month', month);
    if (month === 11 && this.isJalali) {
        newDate = this.today.set('month', 10);
        const d = this.today.$jD;
        newDate = newDate.date(32);
        newDate = newDate.date(d);
    }
    this.today = newDate;
}

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