From 7af7b1c1ae437699822d67f201c0c9449f789277 Mon Sep 17 00:00:00 2001 From: Zvonimir Rudinski Date: Fri, 17 Apr 2026 15:51:00 +0200 Subject: [PATCH] add better filtering --- helpers/html.mjs | 11 +++++++++-- index.mjs | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/helpers/html.mjs b/helpers/html.mjs index 7fbb169..d17d5d0 100644 --- a/helpers/html.mjs +++ b/helpers/html.mjs @@ -1,4 +1,4 @@ -import { format } from "date-fns"; +import { format, getMonth } from "date-fns"; import Handlebars from "handlebars"; import romcal from "romcal"; import { isToday, startOfToday, getYear } from "date-fns"; @@ -9,11 +9,18 @@ import { isToday, startOfToday, getYear } from "date-fns"; * @returns {string} A string containing the CSS styles. */ function css() { + const now = startOfToday(); let color = "#007acc"; // Default color // Get today's liturgical event from the Roman calendar const event = romcal - .calendarFor(getYear(startOfToday())) + .calendarFor({ + year: getYear(now), + country: "croatia", + query: { + month: getMonth(now), + }, + }) .find((e) => isToday(new Date(e.moment))); if (event) { diff --git a/index.mjs b/index.mjs index 0d578b4..052efda 100644 --- a/index.mjs +++ b/index.mjs @@ -8,7 +8,6 @@ import open from "open"; let lastDate = new Date(); let interval; -// Open a hidden screen const app = statusItem(base, { title: "✝️", width: 800,