From 1a1f648a00db83145d7bbf1a178a3f20493e8edf Mon Sep 17 00:00:00 2001 From: Mehdi M Date: Sat, 20 Apr 2024 14:38:55 +0200 Subject: [PATCH] Fix timezone offset overflow ignored when it should end being `'Z'` --- src/temporal/timezone.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/temporal/timezone.js b/src/temporal/timezone.js index 1febd02..92dbcf2 100644 --- a/src/temporal/timezone.js +++ b/src/temporal/timezone.js @@ -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.