react-spectrum
b12a29ee - Fix Ethiopic/Coptic year estimation in julianDayToCE on new year dates (#10424)

Commit
2 days ago
Fix Ethiopic/Coptic year estimation in julianDayToCE on new year dates (#10424) julianDayToCE estimates the year assuming years average exactly 365.25 days, but year starts are placed at 365 * year + floor(year / 4) days after the epoch — up to 3/4 of a day earlier. On the first day of any year not divisible by 4 (3 of every 4 years), the estimate lands one year low, so New Year's Day is reported as the previous year's constrained last day (13-5) and gregorian round trips lose a day. Correct the estimate by comparing against the julian day of the start of the next year, as proposed in #10390. The estimate is never more than one year low and never high, so a single correction suffices, and it only fires on the exact year-start days that were previously wrong. Affects ethiopic, ethioaa and coptic, which share this function.
Author
Parents
Loading