Skip to content
Snippets Groups Projects
Commit 78ff38ea authored by Lily Yan's avatar Lily Yan
Browse files

Merge branch 'feature/ISTWCMS-6155-ebremner-fix-end-dates' into '1.1.x'

ISTWCMS-6155: fixing displaying end date on events when dates span multiple...

See merge request !326
parents 675964a8 5b24dd39
No related branches found
No related tags found
1 merge request!326ISTWCMS-6155: fixing displaying end date on events when dates span multiple...
...@@ -898,23 +898,29 @@ class UwNodeFieldValue { ...@@ -898,23 +898,29 @@ class UwNodeFieldValue {
$return_date = []; $return_date = [];
if ($type == 'event') { if ($type == 'event') {
// Check for same day.
if (date('Ymd', $date['value']) == date('Ymd', $date['end_value'])) {
$return_date['same_day'] = TRUE;
}
else {
$return_date['same_day'] = FALSE;
}
// If this is the same day, get the date and the start and end times. // If this is the same day, get the date and the start and end times.
if ($date['duration'] < '1439') { if ($date['duration'] < '1439') {
$return_date['all_day'] = FALSE; $return_date['all_day'] = FALSE;
$return_date['date_range'] = TRUE; $return_date['date_range'] = TRUE;
$return_date['same_day'] = TRUE;
} }
// This is not the day, get the start and end date with time. // This is not the day, get the start and end date with time.
elseif ($date['duration'] > '1439') { elseif ($date['duration'] > '1439') {
$return_date['all_day'] = FALSE; $return_date['all_day'] = FALSE;
$return_date['date_range'] = TRUE; $return_date['date_range'] = TRUE;
$return_date['same_day'] = FALSE;
} }
// The all date case, duration is always 1439. // The all date case, duration is always 1439.
else { else {
$return_date['all_day'] = TRUE; $return_date['all_day'] = TRUE;
$return_date['date_range'] = TRUE; $return_date['date_range'] = TRUE;
$return_date['same_day'] = FALSE;
} }
$return_date['start_date'] = $date['value']; $return_date['start_date'] = $date['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