mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Calendar: Fix holidays in sidemenu calendar off by 1 day
This commit is contained in:
parent
e5f238584e
commit
991a53c5d6
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user