Skip to content
Snippets Groups Projects
Commit 2b897359 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
parent 7f62272a
No related branches found
No related tags found
No related merge requests found
...@@ -69,15 +69,29 @@ class EventData ...@@ -69,15 +69,29 @@ class EventData
public function toFullcalendarEvent() public function toFullcalendarEvent()
{ {
//Note: The timezone must not be transmitted or // Note: The timezone must not be transmitted or
//the events may be shifted when there is a timezone // the events may be shifted when there is a timezone
//or daylight saving time difference between the server // or daylight saving time difference between the server
//and the client! // and the client!
return [ // 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')
];
}
return $fc_date + [
'resourceId' => $this->range_id, 'resourceId' => $this->range_id,
'start' => $this->begin->format('Y-m-d\TH:i:s'),
'end' => $this->end->format('Y-m-d\TH:i:s'),
'allDay' => $this->all_day,
'title' => $this->title, 'title' => $this->title,
'classNames' => $this->event_classes, 'classNames' => $this->event_classes,
'textColor' => $this->text_colour, 'textColor' => $this->text_colour,
......
...@@ -507,8 +507,7 @@ class CalendarDateAssignment extends SimpleORMap implements Event ...@@ -507,8 +507,7 @@ class CalendarDateAssignment extends SimpleORMap implements Event
return false; return false;
} }
$end = $this->getEnd(); $end = $this->getEnd();
return ($end->format('Ymd') === $begin->format('Ymd') return $end->format('His') === '235959';
&& $end->format('His') === '235959');
} }
public function isWritable(string $user_id): bool public function isWritable(string $user_id): bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment