|
98 | 98 |
|
99 | 99 | {% set event_start_date = content.field_smart_date[0]["#value"] %} |
100 | 100 | {% set event_end_date = content.field_smart_date[0]["#end_value"] %} |
101 | | -{% set all_day_event_text = content.field_smart_date[0]["end"] is null ? content.field_smart_date[0]["start"]["#text"]["time"] : FALSE %} |
| 101 | + |
| 102 | +{% if content.field_smart_date[0]["end"] is null %} |
| 103 | + {% set all_day_event_text = content.field_smart_date[0]["start"]["#text"]["time"] %} |
| 104 | +{% elseif content.field_smart_date[0]["end"]["#text"]["time"]["#format"] is null %} |
| 105 | + {% set all_day_event_text = content.field_smart_date[0]["end"]["#text"]["time"] %} |
| 106 | +{% else %} |
| 107 | + {% set all_day_event_text = FALSE %} |
| 108 | +{% endif %} |
102 | 109 |
|
103 | 110 | {# |
104 | 111 | /** |
|
118 | 125 | * midnight. Timezone value is passed to template from view mode integral to date range value. |
119 | 126 | */ |
120 | 127 | #} |
121 | | - |
122 | 128 | {% set datetime_composed %} |
123 | | - {% if all_day_event_text %} |
124 | | - {{- event_start_date|date("l, F j, Y") }} · {{ all_day_event_text }} |
125 | | - {% elseif multiday_event == false %} |
126 | | - {{ event_start_date|date("l, F j, Y") }} |
127 | | - · |
128 | | - {{ event_start_date|date("g:i a")|replace({"am":"a.m.", "pm":"p.m."}) }}–{{ event_end_date|date("g:i a")|replace({"am":"a.m.", "pm":"p.m."}) }} {{ event_start_date|date("T")|replace({"PST":"PT","PDT":"PT"}) -}} |
129 | | - {% else %} |
130 | | - {{- event_start_date|date("l, F j, Y") }} – {{ event_end_date|date("l, F j, Y") }} |
131 | | - {% endif %} |
132 | | -{% endset %} |
133 | | - |
134 | | -{% set card_media %} |
135 | | - {% if content.field_image|field_value is not empty %} |
136 | | - {{ content.field_image|field_value }} |
137 | | - {% elseif site_setting_entity_by_name('event_default_motif_image') %} |
138 | | - {{ drupal_entity('media', site_setting_entity_by_name('event_default_motif_image').field_motif_image.target_id, 'card_image_only') }} |
139 | | - {% endif %} |
| 129 | + {% if all_day_event_text and multiday_event == false %} |
| 130 | + {{- event_start_date|date("l, F j, Y") }} · {{ all_day_event_text }} |
| 131 | + {% elseif multiday_event == true and all_day_event_text %} |
| 132 | + {{ event_start_date|date("l, F j, Y") }} – {{ event_end_date|date("l, F j, Y") }} |
| 133 | + {% elseif multiday_event == false %} |
| 134 | + {{ event_start_date|date("l, F j, Y") }} |
| 135 | + · |
| 136 | + {{ event_start_date|date("g:i a")|replace({"am":"a.m.", "pm":"p.m."}) }}–{{ event_end_date|date("g:i a")|replace({"am":"a.m.", "pm":"p.m."}) }} {{ event_start_date|date("T")|replace({"PST":"PT","PDT":"PT"}) -}} |
| 137 | + {% else %} |
| 138 | + {{ event_start_date|date("l, F j, Y") }} · {{ event_start_date|date("g:i a")|replace({"am":"a.m.", "pm":"p.m."}) }} –<br /> |
| 139 | + {{ event_end_date|date("l, F j, Y") }} · {{ event_end_date|date("g:i a")|replace({"am":"a.m.", "pm":"p.m."}) -}} {{ event_start_date|date("T")|replace({"PST":"PT","PDT":"PT"}) -}} |
| 140 | + {% endif %} |
140 | 141 | {% endset %} |
141 | 142 |
|
142 | 143 | {% set event_content %} |
|
195 | 196 | {% include '@templates/event-detail/event-detail.twig' with { |
196 | 197 | 'show_admin_info': show_admin_info, |
197 | 198 | 'admin_info': admin_info, |
198 | | - 'image': card_media, |
| 199 | + 'image': content.field_image|field_value, |
199 | 200 | 'start_date': { |
200 | 201 | 'month': event_start_date|date('M'), |
201 | 202 | 'day': event_start_date|date('j') |
|
0 commit comments