Skip to content
Snippets Groups Projects
Commit 27dbb38e authored by Eric Bremner's avatar Eric Bremner
Browse files

Merge branch 'feature/ISTWCMS-7245-kpaxman-all_day_uwevents' into '1.1.x'

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

See merge request !257
parents 27e361cd 5c5c74c7
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
'day' => date('j', $event['next_date']['start_timestamp']),
];
// If the duration is 24 hours we have a possible all
// day event, so we need to check if it is all day.
if ($event['next_date']['duration'] == 1439) {
// 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;
}
// If the all day flag is set and true,
// identify the event as all day.
if (!empty($event['next_date']['all_day'])) {
$event_date['time'] = 'All day';
}
else {
// 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
......
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