SimplQ / simplQ-frontend

Modern and fully web based free queue management open source software.
https://simplq.me
GNU General Public License v3.0
175 stars 135 forks source link

Add check if Intl is defined, set default day value #674

Closed indremak closed 2 years ago

indremak commented 2 years ago

Fix for #673 Fix crash: ReferenceError: Intl is not defined

indremak commented 2 years ago

This will not work: image

There is a typo in your code. It should be Intl, not Intln image

daltonfury42 commented 2 years ago

I intentionally introduced the typo to make the error happen and test you approach. When the function tries to reference Intl that is not present at runtime, we want to handle it and return 'day', but ?. would still lead to the exception.

indremak commented 2 years ago

added checks for Intl and DateTimeFormat types, could you review?

daltonfury42 commented 2 years ago

Thanks @indremak for the PR, and happy october hacking!