From 6cb5939f9b5652784e9308dd68b5181e590424f7 Mon Sep 17 00:00:00 2001 From: Luke Hagar Date: Thu, 18 Jan 2024 10:14:09 -0600 Subject: [PATCH] Remove date time load delay Setting the date outside of the setInterval allows the date-time to populate immediately, and not after one second. --- src/components/widgets/datetime/datetime.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/widgets/datetime/datetime.jsx b/src/components/widgets/datetime/datetime.jsx index 4e1cd6f1..a7aec5da 100644 --- a/src/components/widgets/datetime/datetime.jsx +++ b/src/components/widgets/datetime/datetime.jsx @@ -23,6 +23,7 @@ export default function DateTime({ options }) { useEffect(() => { const dateFormat = new Intl.DateTimeFormat(dateLocale, { ...format }); + setDate(dateFormat.format(new Date())); const interval = setInterval(() => { setDate(dateFormat.format(new Date())); }, 1000);