zoomit-org / Dayjs-Jalali-Plugin

Persian (Jalali, Khorshidi) Plugin for Day.js
MIT License
15 stars 2 forks source link

Problem associated with leap year #23

Open MR-Mostafa opened 1 year ago

MR-Mostafa commented 1 year ago

Hi, I found out that this library uses an incorrect method for calculating leap years, As an example: This library shows Esfand month 1403 as 29 days, which is actually a 30-day month. Additionally, I checked the jalaali-js library and found that it is calculating leap years correctly.

Demo: https://js-r3ebqv.stackblitz.io

Correct: image

Note:

List of leap years (problem is with the leap before the five-year leap) As an example, the year 1408 is a five-year leap, and the leap before this year is 1403. or the year 1441 is a five-year leap, and the leap before this year is 1436. There is no support for five-year leap years in this plugin, and all leap years are based on four-year leap years.

KabiseShamsi1206-1498-new.pdf

amirhmoradi commented 1 year ago

Hi @MR-Mostafa , I have fixed the issue in my own dayjs plugin, that is meant for clean calendar systems management: https://github.com/calidy-com/dayjs-calendarsystems

It does correct conversions to and from persian calendar as well as using standard dayjs api to manage calendar systems. please have a look and let me know if it is useful for you.

hmz22 commented 2 weeks ago

When update this?

sssajjad007 commented 1 day ago

hi, try this https://github.com/sssajjad007/jalali-plugin-dayjs I solved all the package problems, specialy five-year leap years