Merge pull request #3058 from shiqocred/canary

fix: server time is incorrect
This commit is contained in:
Mauricio Siu
2025-11-26 03:03:30 -05:00
committed by GitHub
+13 -7
View File
@@ -44,14 +44,20 @@ export function TimeBadge() {
.padStart(2, "0")}`; .padStart(2, "0")}`;
}; };
const formattedTime = new Intl.DateTimeFormat("en-US", {
timeZone: serverTime.timezone,
timeStyle: "medium",
hour12: false,
}).format(time);
return ( return (
<div className="inline-flex items-center gap-2 rounded-md border px-2 py-1 text-xs sm:text-sm whitespace-nowrap max-w-full overflow-hidden"> <div className="inline-flex items-center rounded-full border p-1 text-xs whitespace-nowrap max-w-full overflow-hidden gap-1">
<span className="hidden sm:inline">Server Time:</span> <div className="inline-flex items-center px-1 gap-1">
<span className="font-medium tabular-nums"> <span className="hidden sm:inline">Server Time:</span>
{time.toLocaleTimeString()} <span className="font-medium tabular-nums">{formattedTime}</span>
</span> </div>
<span className="hidden sm:inline text-muted-foreground"> <span className="hidden sm:inline text-primary/70 border rounded-full bg-foreground/5 px-1.5 py-0.5">
({serverTime.timezone} | {getUtcOffset(serverTime.timezone)}) {serverTime.timezone} | {getUtcOffset(serverTime.timezone)}
</span> </span>
</div> </div>
); );