24hr time switch set in the Clock Menu now effects notification time also. (#184)

This commit is contained in:
Jas Singh
2024-08-25 03:48:07 -07:00
committed by GitHub
parent b990e9c34f
commit 5db6eb336e
2 changed files with 12 additions and 4 deletions

View File

@@ -2,11 +2,15 @@ import GLib from "gi://GLib";
import { Notification } from "types/service/notifications";
import { NotificationIcon } from "./icon.js";
import { notifHasImg } from "../../utils.js";
import options from "options.js";
const time = (time: number, format = "%I:%M %p") =>
GLib.DateTime.new_from_unix_local(time).format(format);
const { military } = options.menus.clock.time;
export const Header = (notif: Notification) => {
const time = (time: number, format = "%I:%M %p") => {
return GLib.DateTime.new_from_unix_local(time).format(military.value ? "%H:%M" : format);
}
return Widget.Box({
vertical: false,
hexpand: true,

View File

@@ -2,11 +2,15 @@ import GLib from "gi://GLib";
import { notifHasImg } from "../../menus/notifications/utils.js";
import { NotificationIcon } from "./icon.js";
import { Notification } from "types/service/notifications";
import options from "options.js";
const time = (time: number, format = "%I:%M %p") =>
GLib.DateTime.new_from_unix_local(time).format(format);
const { military } = options.menus.clock.time;
export const Header = (notif: Notification) => {
const time = (time: number, format = "%I:%M %p") => {
return GLib.DateTime.new_from_unix_local(time).format(military.value ? "%H:%M" : format);
}
return Widget.Box({
vertical: false,
hexpand: true,