Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar-Polyfill #34

Closed
NightScript370 opened this issue Mar 13, 2024 · 3 comments
Closed

Calendar-Polyfill #34

NightScript370 opened this issue Mar 13, 2024 · 3 comments

Comments

@NightScript370
Copy link

On Chrome 72, I am unable to use the Hebrew calendar. I get this error: Uncaught RangeError: Invalid Calendar: hebrew
While I do not mind polyfilling it, I am not sure how to do so. Is there a way I could extract the current calendar configurations for use with the custom Temporal.Calendar?

@NightScript370
Copy link
Author

Also, I tried checking support using Intl.supportedValuesOf(). While that isn't available by default, I did polyfill it through this npm library: https://formatjs.io/docs/polyfills/intl-supportedvaluesof

It reported that it did have hebrew, so I tried the site. Here's the conflict.
image

@arshaw
Copy link
Member

arshaw commented Mar 27, 2024

Hi @NightScript370, sorry about the troubles. temporal-polyfill scrapes out the calendar-data from Intl.DateTimeFormat, and it relies on the calendar option having new-ish support. See this support matrix:

https://caniuse.com/mdn-javascript_builtins_intl_datetimeformat_datetimeformat_options_parameter_options_calendar_parameter

Chrome 80 is required unfortunately.

I'll make sure to add this to the docs.

You might be tempted to polyfill Intl.DateTimeFormat, but unfortunately FormatJS doesn't support anything other than iso/gregorian:

https://formatjs.io/docs/polyfills/intl-datetimeformat

@arshaw
Copy link
Member

arshaw commented Apr 6, 2024

I update the README to explain the higher browser requirements for non-ISO/gregory calendars:
https://github.com/fullcalendar/temporal-polyfill?tab=readme-ov-file#browser-support

I've created a separate ticket for discussing how to polyfill this functionality:
#37

@arshaw arshaw closed this as completed Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants