fix schedule problem when same month and day
This commit is contained in:
parent
96bcd73a0e
commit
e3680dcefb
1 changed files with 8 additions and 2 deletions
|
|
@ -16,8 +16,14 @@ class EventPage extends Page {
|
||||||
$endDay = intval($lastSession->toDate('d'));
|
$endDay = intval($lastSession->toDate('d'));
|
||||||
$endMonth = $lastSession->toDate('MMMM');
|
$endMonth = $lastSession->toDate('MMMM');
|
||||||
|
|
||||||
if ($firstSession->toDate('y-M') === $lastSession->toDate('y-M')) {
|
$isSameMonth = $firstSession->toDate('y-M') === $lastSession->toDate('y-M');
|
||||||
return $startDay . ' - ' . $endDay . ' ' . $endMonth;
|
$isSameDay = $firstSession->toDate('d') === $lastSession->toDate('d');
|
||||||
|
if ($isSameMonth) {
|
||||||
|
if ($isSameDay) {
|
||||||
|
return $startDay . ' ' . $endMonth;
|
||||||
|
} else {
|
||||||
|
return $startDay . ' - ' . $endDay . ' ' . $endMonth;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return $startDay . ' ' . $startMonth . ' - ' . $endDay . ' ' . $endMonth;
|
return $startDay . ' ' . $startMonth . ' - ' . $endDay . ' ' . $endMonth;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue