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'));
|
||||
$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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue