diff --git a/calendar/js/SidemenuDate.ts b/calendar/js/SidemenuDate.ts index 6a294fa66d..5915eeacc8 100644 --- a/calendar/js/SidemenuDate.ts +++ b/calendar/js/SidemenuDate.ts @@ -175,13 +175,14 @@ export class SidemenuDate extends Et2Date protected _onDayCreate(dates : Date[], dStr : string, inst, dayElement : HTMLElement) { //@ts-ignore flatpickr adds dateObj to days - let date = dayElement.dateObj; - if(!date || SidemenuDate._holidays === null) + let date = new Date(dayElement.dateObj); + let f_date = new Date(date.valueOf() - date.getTimezoneOffset() * 60 * 1000); + if(!f_date || SidemenuDate._holidays === null) { return; } - let day_holidays = SidemenuDate._holidays[formatDate(date, {dateFormat: "Ymd"})] + let day_holidays = SidemenuDate._holidays[formatDate(f_date, {dateFormat: "Ymd"})] var tooltip = ''; if(typeof day_holidays !== 'undefined' && day_holidays.length) { diff --git a/calendar/js/app.ts b/calendar/js/app.ts index 31a35cd9d8..8859ed60ca 100644 --- a/calendar/js/app.ts +++ b/calendar/js/app.ts @@ -278,10 +278,10 @@ export class CalendarApp extends EgwApp // Set client side holiday cache for this year // @ts-ignore - if(egw.window.et2_calendar_view) + if(et2_calendar_view) { // @ts-ignore - egw.window.et2_calendar_view.holiday_cache[content.data.year] = content.data.holidays; + et2_calendar_view.holiday_cache[content.data.year] = content.data.holidays; delete content.data.holidays; delete content.data.year; }