Skip to content
Snippets Groups Projects
Commit 5c5c74c7 authored by Kevin Paxman's avatar Kevin Paxman Committed by Eric Bremner
Browse files

ISTWCMS-7245: fix/update Waterloo Event all day logic

parent 27e361cd
No related branches found
No related tags found
1 merge request!257ISTWCMS-7245: fix/update Waterloo Event all day logic
...@@ -136,34 +136,14 @@ class UwCblWaterlooEvents extends BlockBase implements ContainerFactoryPluginInt ...@@ -136,34 +136,14 @@ class UwCblWaterlooEvents extends BlockBase implements ContainerFactoryPluginInt
'day' => date('j', $event['next_date']['start_timestamp']), 'day' => date('j', $event['next_date']['start_timestamp']),
]; ];
// If the duration is 24 hours we have a possible all // If the all day flag is set and true,
// day event, so we need to check if it is all day. // identify the event as all day.
if ($event['next_date']['duration'] == 1439) { if (!empty($event['next_date']['all_day'])) {
$event_date['time'] = 'All day';
// Get the start and end dates.
$start = date('g:i a', strtotime($event['next_date']['start_timestamp']));
$end = date('g:i a', strtotime($event['next_date']['end_timestamp']));
// If the start and end dates are 12 am and pm,
// we have an all day event, if not it is just
// a 24 hour event, so use that time.
if ($start == '12:00 am' && $end == '11:59 pm') {
// Set the info about the listed date.
$event_date['time'] = 'All day';
break;
}
else {
// Set the info about the listed date.
$event_date['time'] = date('g a', $event['next_date']['start_timestamp']);
break;
}
} }
else { else {
// Set the info about the listed date. // Set the info about the listed date.
$event_date['time'] = date('g:i a', $event['next_date']['start_timestamp']); $event_date['time'] = $event['next_date']['start_time'];
} }
// If there is no event date, it means that all the event // If there is no event date, it means that all the event
......
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