neo4j / neo4j-javascript-driver

Neo4j Bolt driver for JavaScript
https://neo4j.com/docs/javascript-manual/current/
Apache License 2.0
853 stars 148 forks source link

Fix DateTime with ZoneId unpacking #1098

Closed bigmontz closed 1 year ago

bigmontz commented 1 year ago

The timezone offset was miss-calculated because of an error on extracting timezone information when the hour equals to 0. The problems happens because Intl.DateTimeFormat when configured with hour12: false returns 0 hour as 24.

The solution for this is convert 24 to 0 before calculate the offset.

NOTE: Other valid solution would be change hourCycle to h23. However, this solution is not supported by all javascript environment.

Backports: https://github.com/neo4j/neo4j-javascript-driver/pull/1097