Skip to content

Commit 7c11ef0

Browse files
committed
Fix timezone offset overflow ignored when it should end being 'Z'
1 parent fec7f51 commit 7c11ef0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/temporal/timezone.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ export function tzOffset(hours = 0, minutes = 0, inRealLifeBoundaries = false) {
7777
*/
7878
let zonedTime = utcMidnight.add({ minutes })
7979

80+
if (!zonedTime.hour && !zonedTime.minute) { return 'Z' }
81+
8082
/**
8183
* Offset sign: `+` (UTC > 0) or `-` (UTC < 0).
8284
* We don’t have condition when minutes is 0: `'Z'` was returned earlier.

0 commit comments

Comments
 (0)