updated time

This commit is contained in:
wt committed 2025-03-14 13:00:59 +07:00
1 parent 4439ccd7bb
commit 874696d394
1 file changed
+10 -8
+10 -8
View File
@@ -1,12 +1,14 @@
import { Variable, GLib } from "astal"
import { Variable, GLib } from "astal";
export default function Time({ format = "%A %e, %H:%M" }) {
const time = Variable<string>("").poll(1000, () =>
GLib.DateTime.new_now_local().format(format)!)
const time = Variable<string>("").poll(
1000,
() => GLib.DateTime.new_now_local().format(format)!,
);
return <label
className="Time"
onDestroy={() => time.drop()}
label={time()}
/>
return (
<button className="Time" onClicked="swaync-client -t">
<label onDestroy={() => time.drop()} label={time()} />
</button>
);
}