diff --git a/frontend-v2/src/lib/home/framework/ui/TerminalLastLine.svelte b/frontend-v2/src/lib/home/framework/ui/TerminalLastLine.svelte index 5b9c881..1da7590 100644 --- a/frontend-v2/src/lib/home/framework/ui/TerminalLastLine.svelte +++ b/frontend-v2/src/lib/home/framework/ui/TerminalLastLine.svelte @@ -22,14 +22,9 @@ }, 50); }, 300); + timeText = dateToLocaleString(new Date()); timeUpdateInterval = setInterval(() => { - const now = new Date(); - timeText = now.toLocaleTimeString('en-US', { - hour: '2-digit', - minute: '2-digit', - second: '2-digit', - hour12: false - }); + timeText = dateToLocaleString(new Date()); }, 1000); }); @@ -43,6 +38,15 @@ timeUpdateInterval = null; } }); + + function dateToLocaleString(date: Date): string { + return date.toLocaleString('en-US', { + hour12: false, + hour: '2-digit', + minute: '2-digit', + second: '2-digit' + }); + }