konzen commented on code in PR #21739:
URL: https://github.com/apache/echarts/pull/21739#discussion_r3807444918


##########
src/util/time.ts:
##########
@@ -325,16 +344,53 @@ export function format(
         .replace(/{ss}/g, pad(s, 2))
         .replace(/{s}/g, s + '')
         .replace(/{SSS}/g, pad(S, 3))
-        .replace(/{S}/g, S + '');
+        .replace(/{S}/g, S + '')
+        .replace(/{ZZ}/g, ZZ)
+        .replace(/{Z}/g, Z);
+}
+
+function formatTimeZoneOffset(offsetMinutes: number, padded: boolean): string {
+    if (!offsetMinutes) {
+        return 'Z';
+    }
+
+    const sign = offsetMinutes < 0 ? '-' : '+';
+    const absoluteOffset = Math.abs(offsetMinutes);
+    const hours = Math.floor(absoluteOffset / 60);
+    const minutes = absoluteOffset % 60;
+    return sign
+        + (padded ? pad(hours, 2) : hours)
+        + (padded || minutes ? ':' + pad(minutes, 2) : '');
 }

Review Comment:
   Fixed in 438a10760. Z is now reserved for timeZone: 'UTC'. A non-UTC IANA 
zone with a zero offset produces +0 for {Z} and +00:00 for {ZZ}. This is 
covered with Africa/Abidjan and documented in apache/echarts-doc#529.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to