A new Temporal.PlainMonthDay
object, representing the month and day specified by info
in the specified calendar
.
Each PlainMonthDay
stores a whole ISO 8601 date internally, which has the same month-day in the target calendar as what's exposed. The reference year is visible when stringifying with toString()
, which outputs an ISO date. The reference year is chosen arbitrarily but consistently (that is, every (monthCode, day)
pair always maps to the same ISO reference year). It does not use the year provided in the input. Instead, the reference year is chosen by finding the latest date before December 31, 1972 that has the same month-day in the target calendar, or the earliest date after December 31, 1972 if no such date exists.
For example, for Gregorian-derived calendars, the reference year is 1972. For the Hebrew calendar, the reference year is 1972 in the Gregorian calendar, but if the month is Adar I (M05L
), which is a leap month, the reference year is 1970 (5730 in Hebrew calendar) instead, because the next leap year is 1973 (5733 in Hebrew calendar), which is after 1972.
This reference year canonicalization ensures that equals()
can directly compare the underlying ISO dates without extra computation.