Skip to content
Snippets Groups Projects
Commit b1ac904a authored by Peter Thienel's avatar Peter Thienel Committed by Moritz Strohm
Browse files

Resolve: "Ganztägige Termine über mehrere Tage werden nicht als Ganztagstermine dargestellt"

Closes #3875

Merge request studip/studip!2731


(cherry picked from commit 2b897359)

0b0a50a8 special treatment for all-day events to display them correctly in fullcalendar, re #3875
parent 7f5a2b6b
No related branches found
No related tags found
No related merge requests found
......@@ -73,11 +73,25 @@ class EventData
// the events may be shifted when there is a timezone
// or daylight saving time difference between the server
// and the client!
return [
'resourceId' => $this->range_id,
// To display all-day events correctly in fullcalendar
// reduce the start and end to date without time and add one day
// to the end date...
if ($this->all_day) {
$fc_date = [
'allDay' => true,
'start' => $this->begin->format('Y-m-d'),
'end' => $this->end->modify('+1 day')->format('Y-m-d')
];
} else {
$fc_date = [
'allDay' => false,
'start' => $this->begin->format('Y-m-d\TH:i:s'),
'end' => $this->end->format('Y-m-d\TH:i:s'),
'allDay' => $this->all_day,
'end' => $this->end->format('Y-m-d\TH:i:s')
];
}
return $fc_date + [
'resourceId' => $this->range_id,
'title' => $this->title,
'classNames' => $this->event_classes,
'textColor' => $this->text_colour,
......
......@@ -507,8 +507,7 @@ class CalendarDateAssignment extends SimpleORMap implements Event
return false;
}
$end = $this->getEnd();
return ($end->format('Ymd') === $begin->format('Ymd')
&& $end->format('His') === '235959');
return $end->format('His') === '235959';
}
public function isWritable(string $user_id): bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment