shahabyazdi / react-multi-date-picker

a simple React datepicker component for working with gregorian, persian, arabic and indian calendars
https://shahabyazdi.github.io/react-multi-date-picker/
MIT License
766 stars 90 forks source link

How is date conversion implemented when switch different calendars? #206

Open olfatgh opened 1 year ago

olfatgh commented 1 year ago

using setting plugin to enable user to use both Gregorian and Arabic calendars, but seems like conversion dates is not prober example: select date 09/01/1386 in Arabic calendar change calendar to Gregorian the selected date is 30/04/1966 while it must be 29/04/1966

so theres one day difference

Screen Shot 2023-06-06 at 13 23 28 Screen Shot 2023-06-06 at 13 23 35
shahabyazdi commented 1 year ago

When calculating the lunar month, there may be a discrepancy of one or, at most, two days. This variation is tied to the calculation method employed by this library, which is based on the information provided in the following reference: https://en.wikipedia.org/wiki/Tabular_Islamic_calendar.

See also: https://shahabyazdi.github.io/react-multi-date-picker/calendars/#calendars