Skip to content
Snippets Groups Projects
Commit 9fe9e208 authored by Eric Bremner's avatar Eric Bremner Committed by Igor Biki
Browse files

ISTWCMS-4917: adding check for only upcoming dates

parent 0900504e
No related branches found
No related tags found
1 merge request!118Feature/istwcms 4917 ebremner upcoming dates
...@@ -611,32 +611,29 @@ class UWService implements UWServiceInterface { ...@@ -611,32 +611,29 @@ class UWService implements UWServiceInterface {
// out correct values. // out correct values.
foreach ($dates as $date) { foreach ($dates as $date) {
// The all day case, duration is always 1439. // Ensure that the dates are greater than now, before
if ($date['duration'] == '1439' && $date['end_value'] > strtotime("now")) { // adding it to the dates array.
$return_dates[] = date('l, F j, Y', $date['value']) . ' (all day)'; if ($date['end_value'] > strtotime("now")) {
}
else { // The all day case, duration is always 1439.
if ($date['duration'] == '1439') {
// If the date is upcoming, meaning greater than right now. $return_dates[] = date('l, F j, Y', $date['value']) . ' (all day)';
// Taking this out for now, will be putting it back, if } else {
// we figure out how to do this in the view.
// if ($date['end_value'] > strtotime("today")) {. // If this is the same day, get the date and the start
// If this is the same day, get the date and the start // and end times.
// and end times. if ($date['duration'] < '1439') {
if ($date['duration'] < '1439') { $start_date = date('l, F j, Y g:i A', $date['value']);
$start_date = date('l, F j, Y g:i A', $date['value']); $end_date = date('g:i A', $date['end_value']);
$end_date = date('g:i A', $date['end_value']); } // This is not the day, get the start and end date with time.
} else {
$start_date = date('l, F j, Y g:i A', $date['value']);
$end_date = date('l, F j, Y g:i A', $date['end_value']);
}
// This is not the day, get the start and end date with time. // Add the start and end date with timezone.
else { $return_dates[] = $start_date . ' - ' . $end_date . ' ' . date('T', $date['end_value']);
$start_date = date('l, F j, Y g:i A', $date['value']);
$end_date = date('l, F j, Y g:i A', $date['end_value']);
} }
// Add the start and end date with timezone.
$return_dates[] = $start_date . ' - ' . $end_date . ' ' . date('T', $date['end_value']);
// }
} }
} }
} }
......
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