From 11888298415ab469214a83b2370241fccdaf9059 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 31 Oct 2026 16:58:27 -0700 Subject: [PATCH] case 4739 - browser that can't name its time zone: its own offset instead of New York Co-Authored-By: Claude Opus 5.5 --- src/api/locale.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/api/locale.js b/src/api/locale.js index 72f58ed..6d39784 100644 --- a/src/api/locale.js +++ b/src/api/locale.js @@ -37,7 +37,7 @@ export default { // Get users default time zone // first check if overriden in useroptions // if not then use browsers own setting - // if that is empty then final default of "America/New_York" + // if the browser can't name its time zone then its current offset from UTC //https://www.iana.org/time-zones //https://en.wikipedia.org/wiki/List_of_tz_database_time_zones getResolvedTimeZoneName() { @@ -49,7 +49,14 @@ export default { if (!window.$gz.util.stringIsNullOrEmpty(tz)) { return tz; } else { - return "America/New_York"; + //case 4739: e.g. a new Windows time zone the browser doesn't know yet; this used to be "America/New_York" + //a fixed offset zone in whole hours, the only kind every browser and luxon accept by name + //(Etc/GMT signs are reversed: UTC-7 is Etc/GMT+7, which is what getTimezoneOffset returns, 420 minutes) + const hours = Math.round(new Date().getTimezoneOffset() / 60); + if (hours == 0) { + return "Etc/GMT"; + } + return `Etc/GMT${hours > 0 ? "+" : "-"}${Math.abs(hours)}`; } } },