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

inLeapYear in islamic-umalqura calendar #2741

Closed
MohsenAlyafei opened this issue Dec 19, 2023 · 2 comments
Closed

inLeapYear in islamic-umalqura calendar #2741

MohsenAlyafei opened this issue Dec 19, 2023 · 2 comments

Comments

@MohsenAlyafei
Copy link

The inLeapYear property gives incorrect status for the "islamic-umalqura" calendar. Some years with 355 days, as stated by the property 'daysInYear" are shown as "false" (i.e. non leap years) while the property should say "true". Others are the opposite.

In Islamic calendars a normal non-leap year is 354 days; while a leap year is 355 days.

Example: This year Islamic year 1445 AH under islamic-umalqura calendar is correctly show with a total of 354 days (i.e. a non-leap year), but the "inLeapYear" property gives "true" indicating that it is a leap year.

@MohsenAlyafei
Copy link
Author

The information provided are incorrect by the Temporal dates for Islamic calendars.

An example of 1st day of 1st month of this year 1445 AH.

const d = Temporal.PlainDate.from({year:1445, month:1, day:1, calendar: 'islamic-umalqura'});
console.log(d);

The ouput:

Temporal.PlainDate {}
calendarId: "islamic-umalqura"
day: 1
dayOfWeek: 3
dayOfYear: 248   // <== Incorrect day of year should be 1
daysInMonth: 29
daysInWeek: 7
daysInYear: 354  // <== Correct
era: "ah"
eraYear: 1445
inLeapYear: true // incorrect should be false because it is a 354 day’s year
month: 1
monthCode: "M01"
monthsInYear: 12
weekOfYear: 29    // should be 1
year: 1445
yearOfWeek: 2023  // should be 1445

@ptomato
Copy link
Collaborator

ptomato commented Jan 15, 2024

The dayOfYear and inLeapYear issues have been fixed by #2743. weekOfYear and yearOfWeek are pending on #2744 so let's close this and move any further discussion over to there.

@ptomato ptomato closed this as completed Jan 15, 2024
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

2 participants