From 49d3df43d33095dda07795c0f5119bfa434ee99c Mon Sep 17 00:00:00 2001 From: naskya Date: Tue, 21 Mar 2023 08:24:02 +0900 Subject: [PATCH] fix: local time for users --- packages/client/src/pages/user/home.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pages/user/home.vue b/packages/client/src/pages/user/home.vue index 360bf77ba9..a42bb07364 100644 --- a/packages/client/src/pages/user/home.vue +++ b/packages/client/src/pages/user/home.vue @@ -167,8 +167,8 @@ const timeForThem = $computed(() => { const tzInfo = cityTimezones.lookupViaCity(props.user.location!.replace(/\s.*/,'')); if (tzInfo.length == 0) return ""; const tz = tzInfo[0].timezone; - const theirTime = new Date().toLocaleString("en-US", { timeZone: tz, hour12: true }) - return ` (${theirTime.split(",")[1].trim().split(":")[0]} ${theirTime.split(" ")[1].slice(-2)})` + const theirTime = new Date().toLocaleString("en-US", { timeZone: tz, hour12: false }); + return ` (${theirTime.split(",")[1].trim().split(":")[0]}:${theirTime.split(" ")[1].slice(-5,-3)})`; }) function menu(ev) {