fix: bad response for holidays from caldav
This commit is contained in:
parent
923672a418
commit
df5c189743
@ -73,11 +73,17 @@ type CalendarHandler struct{}
|
|||||||
|
|
||||||
func (c *CalendarHandler) ServeHTTP(w http.ResponseWriter, _ *http.Request) {
|
func (c *CalendarHandler) ServeHTTP(w http.ResponseWriter, _ *http.Request) {
|
||||||
now := time.Now()
|
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{
|
cd := CalendarDay{
|
||||||
Day: now,
|
Day: now,
|
||||||
WorkingDay: cal.IsWorkingDay(now),
|
WorkingDay: cal.IsWorkingDay(now),
|
||||||
Ferie: cal.IsHoliday(now),
|
Ferie: cal.IsHoliday(now),
|
||||||
Holiday: cal.IsHoliday(now),
|
Holiday: calDavHolidays,
|
||||||
Weekday: cal.IsWeekDay(now),
|
Weekday: cal.IsWeekDay(now),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user