BLOG-58 Rewrite frontend with svelte kit #61
@ -22,14 +22,9 @@
|
|||||||
}, 50);
|
}, 50);
|
||||||
}, 300);
|
}, 300);
|
||||||
|
|
||||||
|
timeText = dateToLocaleString(new Date());
|
||||||
timeUpdateInterval = setInterval(() => {
|
timeUpdateInterval = setInterval(() => {
|
||||||
const now = new Date();
|
timeText = dateToLocaleString(new Date());
|
||||||
timeText = now.toLocaleTimeString('en-US', {
|
|
||||||
hour: '2-digit',
|
|
||||||
minute: '2-digit',
|
|
||||||
second: '2-digit',
|
|
||||||
hour12: false
|
|
||||||
});
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -43,6 +38,15 @@
|
|||||||
timeUpdateInterval = null;
|
timeUpdateInterval = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function dateToLocaleString(date: Date): string {
|
||||||
|
return date.toLocaleString('en-US', {
|
||||||
|
hour12: false,
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
second: '2-digit'
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex w-full flex-col pt-1.5 leading-5 md:pt-2.5 md:leading-7">
|
<div class="flex w-full flex-col pt-1.5 leading-5 md:pt-2.5 md:leading-7">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user