Skip to content

Commit 061ca6c

Browse files
authored
Merge pull request #3058 from shiqocred/canary
fix: server time is incorrect
2 parents e576c1a + daff2ad commit 061ca6c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

apps/dokploy/components/ui/time-badge.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,20 @@ export function TimeBadge() {
4444
.padStart(2, "0")}`;
4545
};
4646

47+
const formattedTime = new Intl.DateTimeFormat("en-US", {
48+
timeZone: serverTime.timezone,
49+
timeStyle: "medium",
50+
hour12: false,
51+
}).format(time);
52+
4753
return (
48-
<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">
49-
<span className="hidden sm:inline">Server Time:</span>
50-
<span className="font-medium tabular-nums">
51-
{time.toLocaleTimeString()}
52-
</span>
53-
<span className="hidden sm:inline text-muted-foreground">
54-
({serverTime.timezone} | {getUtcOffset(serverTime.timezone)})
54+
<div className="inline-flex items-center rounded-full border p-1 text-xs whitespace-nowrap max-w-full overflow-hidden gap-1">
55+
<div className="inline-flex items-center px-1 gap-1">
56+
<span className="hidden sm:inline">Server Time:</span>
57+
<span className="font-medium tabular-nums">{formattedTime}</span>
58+
</div>
59+
<span className="hidden sm:inline text-primary/70 border rounded-full bg-foreground/5 px-1.5 py-0.5">
60+
{serverTime.timezone} | {getUtcOffset(serverTime.timezone)}
5561
</span>
5662
</div>
5763
);

0 commit comments

Comments
 (0)