moment / luxon

⏱ A library for working with dates and times in JS
https://moment.github.io/luxon
MIT License
15.4k stars 729 forks source link

Islamic calendar bug with 29 Zilhaj / 1 Muharram #1263

Open noorix1 opened 2 years ago

noorix1 commented 2 years ago

The calendar conversion from gregorian to islamic date is not working. However, islamicc (islamic civil) is working.

To Reproduce let date1 = DateTime.fromISO('2023-07-17').reconfigure({outputCalendar: "islamic"}) let date2 = DateTime.fromISO('2023-07-18').reconfigure({outputCalendar: "islamic"}) let date3 = DateTime.fromISO('2023-07-19').reconfigure({outputCalendar: "islamic"})

OUTPUT 29/12/1444 AH 30/12/1444 AH 02/01/1445 AH

There is no 30 Zilhaj (30/12/1444). The month ends on 29th. It should be 01/01/1445 (i-e 1st Muharram 1445)

Tested on Luxon 3.0.1. Using Chrome Version 103.0.5060.134 (Official Build) (arm64) I am using this in an Angular Application for frontend.

Also if I use Islamic Civil calendar, the conversion is working, however the dates are offset by 1 which doesn't work for me.

let date1 = DateTime.fromISO('2023-07-17').reconfigure({outputCalendar: "islamicc"})
let date2 = DateTime.fromISO('2023-07-18').reconfigure({outputCalendar: "islamicc"})
let date3 = DateTime.fromISO('2023-07-19').reconfigure({outputCalendar: "islamicc"})

28/12/1444 AH 29/12/1444 AH 01/01/1445 AH

icambron commented 2 years ago

@noorix1 We're just using the built-in Intl support to format Islamic and Islamic Civil calendar dates. If you can show that using the Intl API directly gives you different results, then we can see what might be the matter. But if the Intl API gives you these same results, then you'll need to take it up with the implementors of the Intl APIs in the various browsers.

diesieben07 commented 1 year ago

I was unable to reproduce this in Chromium 103.