luxon icon indicating copy to clipboard operation
luxon copied to clipboard

Islamic calendar bug with 29 Zilhaj / 1 Muharram

Open noorix1 opened this issue 2 years ago • 2 comments

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

noorix1 avatar Aug 09 '22 01:08 noorix1

@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.

icambron avatar Aug 26 '22 16:08 icambron

I was unable to reproduce this in Chromium 103.

diesieben07 avatar Mar 07 '23 19:03 diesieben07