From df5c189743cd3d9cb5983ce8c9accba0f5382c8e Mon Sep 17 00:00:00 2001 From: Cyrille Nofficial Date: Fri, 27 May 2022 11:01:13 +0200 Subject: [PATCH] fix: bad response for holidays from caldav --- cmd/domogeek/domogeek.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/domogeek/domogeek.go b/cmd/domogeek/domogeek.go index 053a944..aa6a7a2 100644 --- a/cmd/domogeek/domogeek.go +++ b/cmd/domogeek/domogeek.go @@ -73,11 +73,17 @@ type CalendarHandler struct{} func (c *CalendarHandler) ServeHTTP(w http.ResponseWriter, _ *http.Request) { now := time.Now() + calDavHolidays, err := cal.IsHolidaysFromCaldav(now) + if err != nil { + zap.S().Warnf("unable to read holliday status from caldav: %v", err) + calDavHolidays = false + } + cd := CalendarDay{ Day: now, WorkingDay: cal.IsWorkingDay(now), Ferie: cal.IsHoliday(now), - Holiday: cal.IsHoliday(now), + Holiday: calDavHolidays, Weekday: cal.IsWeekDay(now), }