js-temporal / temporal-polyfill

Polyfill for Temporal (under construction)
ISC License
529 stars 28 forks source link

Islamic Calendars incorrect dayOfYear #271

Open MohsenAlyafei opened 11 months ago

MohsenAlyafei commented 11 months ago

The dayOfYear property does not return the day of the year for the given Islamic calendars' dates but rather to the day of year for the corresponding gregorian calendar.

The first day of this year 1445 AH is day 248 of the islamic year which is incorrect.

This doesn't seem to be correct specification.

This is also the case with the Persian calendar.

Currently to get the dayOfYear is to use the "since" or "until" methods to calculate the day from the start of the given Islamic year.

The weekOfYear is also incorrect for the Islamic calendars and shows the iso week number instead ! The week in Islamic calendar is a simple days since the start of year divide by 7 rounded up to an integer.