Skip to content

Conversation

@ptomato
Copy link
Contributor

@ptomato ptomato commented Nov 22, 2025

Tests for constraining end-of-month days when adding/changing months and years in the two tabular Hijri calendars (islamic-civil and islamic-tbla). Expands the existing tests that were already here.

As usual, I recommend reviewing the tests in PlainDate/prototype/add and /with carefully, and spot-checking the others which are very similar.

Tests for year and month arithmetic around constraining the day to the
end of a 29 or 30 day month in leap and common years, in the
islamic-civil calendar, for add(), subtract(), and with().

(This is a tabular calendar, so leap and common years follow a
mathematical pattern. Odd months have 30 days and even months have 29,
except the last month which has 30 days in leap years.)
Tests for year and month arithmetic around constraining the day to the
end of a 29 or 30 day month in leap and common years, in the
islamic-tbla calendar, for add(), subtract(), and with().

(This is a tabular calendar. Leap years and month lengths are the same
as in the islamic-civil calendar in the previous commit. The epoch day
is different which doesn't make a difference to the result of these
tests, so they are nearly identical to the islamic-civil tests in the
previous commit.)
@ptomato ptomato requested a review from a team as a code owner November 22, 2025 02:56
ptomato added a commit to ptomato/test262 that referenced this pull request Nov 24, 2025
Similar to tc39#4700 but this is for an
observational Hijri calendar, not a tabular one. Any month may have
either 29 or 30 days in any year. So we additionally test adding or
subtracting 1 year from day 30 of a month, and landing in a year where
that month has 29 days.

Observational month lengths are provided in a comment for convenience.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant