diff --git a/site/models/event.php b/site/models/event.php index 867a42a..96ca828 100644 --- a/site/models/event.php +++ b/site/models/event.php @@ -16,8 +16,14 @@ class EventPage extends Page { $endDay = intval($lastSession->toDate('d')); $endMonth = $lastSession->toDate('MMMM'); - if ($firstSession->toDate('y-M') === $lastSession->toDate('y-M')) { - return $startDay . ' - ' . $endDay . ' ' . $endMonth; + $isSameMonth = $firstSession->toDate('y-M') === $lastSession->toDate('y-M'); + $isSameDay = $firstSession->toDate('d') === $lastSession->toDate('d'); + if ($isSameMonth) { + if ($isSameDay) { + return $startDay . ' ' . $endMonth; + } else { + return $startDay . ' - ' . $endDay . ' ' . $endMonth; + } } else { return $startDay . ' ' . $startMonth . ' - ' . $endDay . ' ' . $endMonth; }