13 lines
328 B
TypeScript
Raw Normal View History

2024-12-27 15:42:51 +03:00
import { Variable, GLib } from "astal"
2024-12-28 22:14:11 +03:00
export default function Time({ format = "%e %b - %H:%M %a" }) {
2024-12-27 15:42:51 +03:00
const time = Variable<string>("").poll(1000, () =>
GLib.DateTime.new_now_local().format(format)!)
return <label
className="Time"
onDestroy={() => time.drop()}
label={time()}
/>
}