mirror of
https://github.com/zoriya/flake.git
synced 2025-12-05 22:26:21 +00:00
15 lines
416 B
JavaScript
15 lines
416 B
JavaScript
import GLib from "gi://GLib";
|
|
|
|
export const clock = Variable(GLib.DateTime.new_now_local(), {
|
|
poll: [1000, () => GLib.DateTime.new_now_local()],
|
|
});
|
|
|
|
/**
|
|
* @param {{format?: string} & import("../types/widgets/label").LabelProps} props
|
|
*/
|
|
export const Clock = ({ format = "%a %d %b %H:%M ", ...props } = {}) =>
|
|
Widget.Label({
|
|
...props,
|
|
label: Utils.derive([clock], (c) => c.format(format) || "").bind(),
|
|
});
|