FIX: action comm list: holiday last day not included + handle duration with halfdays

This commit is contained in:
Marc de Lima Lucio 2022-04-07 17:17:20 +02:00
parent d26c578e97
commit 6e0888ca0e

View File

@ -979,8 +979,8 @@ if ($resql) {
$event->type = 'holiday';
$event->type_picto = 'holiday';
$event->datep = $db->jdate($obj->date_start);
$event->datef = $db->jdate($obj->date_end);
$event->datep = $db->jdate($obj->date_start) + (empty($halfday) || $halfday == 1 ? 0 : 12 * 60 * 60 - 1);
$event->datef = $db->jdate($obj->date_end) + (empty($halfday) || $halfday == -1 ? 24 : 12) * 60 * 60 - 1;
$event->date_start_in_calendar = $event->datep;
$event->date_end_in_calendar = $event->datef;