Issue #34 made explicit that non-ISO/gregory calendar support (like chinese, persian, hebrew) have higher minimum browser requirements than other features:
Aside from polyfilling calendar support into Intl.DateTimeFormat, one might be able to hook-in the required calendar computations into temporal-polyfill itself. However, then formatting functions like toLocaleString would not work, nor would passing in Temporal objects to Intl.DatetimeFormat::format(). In my opinion, polyfilling calendar support into Intl.DateTimeFormat is the best way.
This ticket proposes polyfilling calendar support into Intl.DateTimeFormat.
It'd be theoretically possible to scrape-out information about formatting from a modern browser that supports calendar. It would be challenging because nearly every permutation of the Intl.DateTimeFormat must be considered.
Issue #34 made explicit that non-ISO/gregory calendar support (like
chinese
,persian
,hebrew
) have higher minimum browser requirements than other features:(Feb 2020)
(May 2020)
(Apr 2021)
(Apr 2021)
(Feb 2020)
(Apr 2020)
This is because temporal-polyfill relies on the
Intl.DateTimeFormat
constructor supporting thecalendar
option.To be able to support older browsers, the
calendar
option would need be polyfilled. Unfortunately Format.JS explicitly does not support any calendar other than ISO/gregory.Aside from polyfilling
calendar
support intoIntl.DateTimeFormat
, one might be able to hook-in the required calendar computations into temporal-polyfill itself. However, then formatting functions liketoLocaleString
would not work, nor would passing in Temporal objects toIntl.DatetimeFormat::format()
. In my opinion, polyfillingcalendar
support intoIntl.DateTimeFormat
is the best way.This ticket proposes polyfilling
calendar
support intoIntl.DateTimeFormat
.It'd be possible to use
@internationalized/date
's calendar y/m/w/d computations: https://github.com/adobe/react-spectrum/tree/main/packages/%40internationalized/date/src/calendarsIt'd be theoretically possible to scrape-out information about formatting from a modern browser that supports
calendar
. It would be challenging because nearly every permutation of the Intl.DateTimeFormat must be considered.