From 5ac62cc1a4d9a5f50ea26d5bc1afb0fbf95da23c Mon Sep 17 00:00:00 2001
From: darkuss <darkussdelta@gmail.com>
Date: Thu, 13 Aug 2026 05:13:32 +0200
Subject: init

---
 src/taskbar/time.tsx | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 src/taskbar/time.tsx

(limited to 'src/taskbar/time.tsx')

diff --git a/src/taskbar/time.tsx b/src/taskbar/time.tsx
new file mode 100644
index 0000000..053147b
--- /dev/null
+++ b/src/taskbar/time.tsx
@@ -0,0 +1,23 @@
+import { useEffect, useState } from "preact/hooks";
+
+const dateTimeFormat = new Intl.DateTimeFormat();
+const timezoneId = Temporal.Now.timeZoneId();
+
+export function Time() {
+    const [time, setTime] = useState(Temporal.Now.instant().toZonedDateTimeISO(timezoneId))
+
+    useEffect(() => {
+        const id = setInterval(() => {
+            setTime(time => time.add({ seconds: 1 }));
+        }, 1000)
+
+        return () => {
+            clearInterval(id);
+        }
+    }, [])
+
+    return <div id="time">
+        <div>{dateTimeFormat.format(time.toPlainTime())}</div>
+        <div>{dateTimeFormat.format(time.toPlainDate())}</div>
+    </div>
+}
-- 
cgit v1.2.3

