Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix timezone offset overflow ignored when it should end being 'Z'
Browse files Browse the repository at this point in the history
meduzen committed Apr 20, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tvdeyen Thomas von Deyen
1 parent fec7f51 commit 7c11ef0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/temporal/timezone.js
Original file line number Diff line number Diff line change
@@ -77,6 +77,8 @@ export function tzOffset(hours = 0, minutes = 0, inRealLifeBoundaries = false) {
*/
let zonedTime = utcMidnight.add({ minutes })

if (!zonedTime.hour && !zonedTime.minute) { return 'Z' }

/**
* Offset sign: `+` (UTC > 0) or `-` (UTC < 0).
* We don’t have condition when minutes is 0: `'Z'` was returned earlier.

0 comments on commit 7c11ef0

Please sign in to comment.