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

Fix duck test to match Zone interface #1437

Closed justinbhopper closed 1 year ago

justinbhopper commented 1 year ago

Fixes #1426

normalizeZone uses offset on a Zone for the duck test, but incorrectly assumes it is a property that returns a number when in fact it is a function/method on Zone.

The duck test is particularly important for scenarios where package dependencies brought in their own copy of luxon (perhaps due to version mismatches), causing the instance of check to fail. The duck test helps ensure compatibility with other instances of luxon modules.

linux-foundation-easycla[bot] commented 1 year ago

CLA Signed

The committers listed above are authorized under a signed CLA.

icambron commented 1 year ago

@justinbhopper thanks