aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/event.php15
-rwxr-xr-xview/tpl/event_item_header.tpl5
2 files changed, 18 insertions, 2 deletions
diff --git a/include/event.php b/include/event.php
index d39da227c..c8f9d2561 100644
--- a/include/event.php
+++ b/include/event.php
@@ -76,7 +76,17 @@ function format_event_obj($jobject) {
//ensure compatibility with older items - this check can be removed at a later point
if(array_key_exists('description', $object)) {
- $tz = (($object['timezone']) ? $object['timezone'] : 'UTC');
+ $event_tz = '';
+ if(is_array($object['asld']) && isset($object['asld']['attachment'])) {
+ foreach($object['asld']['attachment'] as $attachment) {
+ if($attachment['type'] === 'PropertyValue' && $attachment['name'] == 'zot.event.timezone' ) {
+ $event_tz = $attachment['value'];
+ break;
+ }
+ }
+
+ }
+
$allday = (($object['adjust']) ? false : true);
$dtstart = new DateTime($object['dtstart']);
@@ -104,7 +114,8 @@ function format_event_obj($jobject) {
'$dtend_title' => datetime_convert('UTC', date_default_timezone_get(), $object['dtend'], (($object['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )),
'$dtend_dt' => (($object['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $object['dtend'] , $bd_format )) : day_translate(datetime_convert('UTC', 'UTC', $object['dtend'] , $bd_format ))),
'$allday' => $allday,
- '$oneday' => $oneday
+ '$oneday' => $oneday,
+ '$event_tz' => ['label' => t('Timezone'), 'value' => (($event_tz === date_default_timezone_get()) ? '' : $event_tz)]
));
$event['content'] = replace_macros(get_markup_template('event_item_content.tpl'),array(
diff --git a/view/tpl/event_item_header.tpl b/view/tpl/event_item_header.tpl
index ed46c304f..e81db48a1 100755
--- a/view/tpl/event_item_header.tpl
+++ b/view/tpl/event_item_header.tpl
@@ -15,3 +15,8 @@
</div>
{{/if}}
{{/if}}
+{{if $event_tz.value}}
+<div class="event-item-start">
+ <span class="event-item-label">{{$event_tz.label}}:</span>&nbsp;<span class="timezone" title="{{$event_tz.value}}">{{$event_tz.value}}</span>
+</div>
+{{/if}}