From 4cb8b0f4f4264edc280e882dbc8af449e5f66073 Mon Sep 17 00:00:00 2001 From: develoopeer Date: Thu, 14 Nov 2024 09:06:47 +0300 Subject: [PATCH] - Calendar template fixed - Bug with ics events, from another years fixed --- internal/assets/templates/calendar.html | 24 +++++++++++++----------- internal/feed/calendar.go | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/internal/assets/templates/calendar.html b/internal/assets/templates/calendar.html index 5feabc0..7e6708b 100644 --- a/internal/assets/templates/calendar.html +++ b/internal/assets/templates/calendar.html @@ -1,6 +1,6 @@ {{ template "widget-base.html" . }} -{{ define "widget-content" }} {{ define "widget-content" }} +{{ define "widget-content" }}
{{ .Calendar.CurrentMonthName }}
@@ -20,15 +20,17 @@
Su
-
- {{ range .Calendar.Days }} -
- {{ if .IsEvent}} -
- {{ .Event.EventHover }} -
- {{ end }} - {{ .Day }} +
+ {{ range .Calendar.Days }} +
+ {{ if .IsEvent}} +
+ {{ .Event.EventHover }} +
+ {{ end }} + {{ .Day }}
+ {{ end }} +
-{{ end }} \ No newline at end of file +{{ end }} diff --git a/internal/feed/calendar.go b/internal/feed/calendar.go index b4e6d3e..b94c506 100644 --- a/internal/feed/calendar.go +++ b/internal/feed/calendar.go @@ -53,7 +53,7 @@ func NewCalendar(now time.Time, icsurl string) *Calendar { if err != nil { log.Panic(err) } - if startAt.Day() == day && startAt.Month() == month { + if startAt.Day() == day && startAt.Month() == month && startAt.Year() == year { dayEvent.StartedDay = startAt dayEvent.EventHover = event.GetProperty("SUMMARY").Value days[i].IsEvent = true