15 lines
368 B
TypeScript
15 lines
368 B
TypeScript
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)!,
|
|
);
|
|
|
|
return (
|
|
<button className="Time" onClicked="swaync-client -t">
|
|
<label onDestroy={() => time.drop()} label={time()} />
|
|
</button>
|
|
);
|
|
}
|