mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 20:49:08 +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)
|
protected _onDayCreate(dates : Date[], dStr : string, inst, dayElement : HTMLElement)
|
||||||
{
|
{
|
||||||
//@ts-ignore flatpickr adds dateObj to days
|
//@ts-ignore flatpickr adds dateObj to days
|
||||||
let date = dayElement.dateObj;
|
let date = new Date(dayElement.dateObj);
|
||||||
if(!date || SidemenuDate._holidays === null)
|
let f_date = new Date(date.valueOf() - date.getTimezoneOffset() * 60 * 1000);
|
||||||
|
if(!f_date || SidemenuDate._holidays === null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let day_holidays = SidemenuDate._holidays[formatDate(date, {dateFormat: "Ymd"})]
|
let day_holidays = SidemenuDate._holidays[formatDate(f_date, {dateFormat: "Ymd"})]
|
||||||
var tooltip = '';
|
var tooltip = '';
|
||||||
if(typeof day_holidays !== 'undefined' && day_holidays.length)
|
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
|
// Set client side holiday cache for this year
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if(egw.window.et2_calendar_view)
|
if(et2_calendar_view)
|
||||||
{
|
{
|
||||||
// @ts-ignore
|
// @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.holidays;
|
||||||
delete content.data.year;
|
delete content.data.year;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user