From 8ec6294a7e92a0818675e956eb7e9a031111badb Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Mon, 9 Sep 2024 17:29:30 +0100 Subject: [PATCH] Use browser default timezone. --- src/components/structures/LoggedInView.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 1a92748375a..a77b9a31855 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -205,7 +205,6 @@ class LoggedInView extends React.Component { } private onTimezoneUpdate = async (): Promise => { - console.log("Triggering timezoen update", SettingsStore); if (!SettingsStore.getValue("userTimezonePublish")) { // Ensure it's deleted try { @@ -215,7 +214,9 @@ class LoggedInView extends React.Component { } return; } - const currentTimezone = SettingsStore.getValue("userTimezone"); + const currentTimezone = SettingsStore.getValue("userTimezone") + // If the timezone is empty, then use the browser timezone. + || Intl.DateTimeFormat().resolvedOptions().timeZone; if (!currentTimezone || typeof currentTimezone !== "string") { return; }