moment / luxon

⏱ A library for working with dates and times in JS
https://moment.github.io/luxon
MIT License
15.23k stars 730 forks source link

Duck check fails in normalizeZone #1426

Closed justinbhopper closed 1 year ago

justinbhopper commented 1 year ago

Describe the bug In my scenario, I believe I have a date whose zone instance came from a separate node module, and thus the instanceof Zone check fails. I see you have duck checking in the normalizeZone function to handle this use-case.

However, it appears to be written with the wrong assumption that offset is a getter property, whereas it seems actually to be defined as a function in Zone.js. This causes the check to fail unexpectedly.

image