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

ISTWCMS-5736: fixing dates with time

parent 1d9d9844
No related branches found
No related tags found
1 merge request!258ISTWCMS-5736: fixing dates with time
......@@ -694,6 +694,11 @@ class UwNodeFieldValue {
$return_dates = [];
// If there is no dates to process, return empty array.
if (!$node->$field_name->value) {
return $return_dates;
}
// If this is not and event, just get the date.
if ($node->getType() !== 'uw_ct_event') {
$return_dates[] = $this->getDate([$node->$field_name->value], 'blog');
......@@ -904,7 +909,15 @@ class UwNodeFieldValue {
$return_date['end_date'] = $date['end_value'];
}
else {
$return_date['date'] = $date[0];
// If the date contains a time code, we need to convert
// it, because it is stored in UTC.
if (strpos($date[0], 'T')) {
$return_date['date'] = date('c', strtotime($date[0] . ' UTC'));
}
else {
$return_date['date'] = $date[0];
}
}
return $return_date;
......
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