iansinnott / jstz

🌐Timezone detection for JavaScript
Other
176 stars 33 forks source link

Fix overriding Intl in docs on Rails usage. #9

Closed AndrewSouthpaw closed 7 years ago

AndrewSouthpaw commented 7 years ago

Apparently iOS complains when you use Object.defineProperty to override Intl. There doesn't seem to be a good way to force it, so just wrap the operation in a try block and default to original behavior when it fails.

I've also heard that Intl actually does play nicely with Rails, I still need to do some research there, but in the mean time I wanted to fix the docs so it's not putting out code that will bust on some browsers.

iansinnott commented 7 years ago

Awesome, thanks @AndrewSouthpaw