Closed eliashdezr closed 1 year ago
Describe the bug Parsing a ISO string with timezone information is not preserved in the toJSDate() function
toJSDate()
To Reproduce
const originalIso = "2022-10-18T15:00:00.000-04:00"; const jsDate = DateTime.fromISO(originalIso) .setZone("America/New_York") .toJSDate(); const jsDateNoSetZone = DateTime.fromISO(originalIso).toJSDate();
Actual vs Expected behavior Actual Tue Oct 18 2022 14:00:00 GMT-0500 (Central Daylight Time)
Tue Oct 18 2022 14:00:00 GMT-0500 (Central Daylight Time)
Expected Tue Oct 18 2022 15:00:00 GMT-0400 (Eastern Time)
Tue Oct 18 2022 15:00:00 GMT-0400 (Eastern Time)
https://codesandbox.io/s/determined-ptolemy-lfmxih?file=/src/index.js:496-553
Desktop (please complete the following information):
The native date type doesn't support time zones
Closing bc age. This is more of a misunderstanding about the native date than it is a Luxon issue.
Describe the bug Parsing a ISO string with timezone information is not preserved in the
toJSDate()
functionTo Reproduce
Actual vs Expected behavior Actual
Tue Oct 18 2022 14:00:00 GMT-0500 (Central Daylight Time)
Expected
Tue Oct 18 2022 15:00:00 GMT-0400 (Eastern Time)
https://codesandbox.io/s/determined-ptolemy-lfmxih?file=/src/index.js:496-553
Desktop (please complete the following information):