Closed khanhhuy closed 2 years ago
How confident are you that the version of Luxon you have hanging on your window var is 2.0.2?
Try going to here, opening dev tools, and running this in your console:
luxon.DateTime.fromObject({ year: 2021, month: 11, day: 4 }, { zone: 'Europe/Paris' }).zoneName
That gives me "Europe/Paris".
Part of why I'm guessing this is a version issue is that Luxon v1.x required the zone
option in the first arg instead of in the second arg. We changed that in 2.0 so that it's part of a second arg. So if you were accidentally using Luxon 1.x, you'd get this behavior.
Hi @icambron, thank you for your reply. You're totally correct, my browser version is ^1.2.6
. I'm having some other libraries that use luxon 2.0.2
and I wasn't aware of these inconsistencies.
Thanks again for your help on this, I'll close this issue.
Describe the bug
DateTime.fromObject(..., zone)
does set the zone to the newly created instance when using with Chrome. But it does set the zone when using with NodeJSTo Reproduce
luxon@^2.0.2
Asia/Saigon
Actual vs Expected behavior
zoneName
should beEurope/Paris
Asia/Saigon
Additional context Do the same test using NodeJS, and the zone name is set correctly.