Skip to content

Commit

Permalink
Fix timezone offset overflow ignored when it should end being 'Z'
Browse files Browse the repository at this point in the history
  • Loading branch information
meduzen committed Apr 20, 2024
1 parent f1c6a0e commit 1a1f648
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
Expand Up @@ -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.
Expand Down

0 comments on commit 1a1f648

Please sign in to comment.