add better filtering
This commit is contained in:
+9
-2
@@ -1,4 +1,4 @@
|
|||||||
import { format } from "date-fns";
|
import { format, getMonth } from "date-fns";
|
||||||
import Handlebars from "handlebars";
|
import Handlebars from "handlebars";
|
||||||
import romcal from "romcal";
|
import romcal from "romcal";
|
||||||
import { isToday, startOfToday, getYear } from "date-fns";
|
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.
|
* @returns {string} A string containing the CSS styles.
|
||||||
*/
|
*/
|
||||||
function css() {
|
function css() {
|
||||||
|
const now = startOfToday();
|
||||||
let color = "#007acc"; // Default color
|
let color = "#007acc"; // Default color
|
||||||
|
|
||||||
// Get today's liturgical event from the Roman calendar
|
// Get today's liturgical event from the Roman calendar
|
||||||
const event = romcal
|
const event = romcal
|
||||||
.calendarFor(getYear(startOfToday()))
|
.calendarFor({
|
||||||
|
year: getYear(now),
|
||||||
|
country: "croatia",
|
||||||
|
query: {
|
||||||
|
month: getMonth(now),
|
||||||
|
},
|
||||||
|
})
|
||||||
.find((e) => isToday(new Date(e.moment)));
|
.find((e) => isToday(new Date(e.moment)));
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user