Remove date time load delay
Setting the date outside of the setInterval allows the date-time to populate immediately, and not after one second.
This commit is contained in:
parent
7f621ed518
commit
6cb5939f9b
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user