Skip to content

Commit 9ae750c

Browse files
committed
Fixed other localizeddate usages
1 parent 7ee78ce commit 9ae750c

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

app/Resources/views/admin/blog/index.html.twig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
<tr>
2020
<td>{{ post.title }}</td>
2121
<td>{{ post.authorEmail }}</td>
22-
<td>{% if post.publishedAt %}{{ post.publishedAt|localizeddate('short', 'short') }}{% endif %}</td>
22+
{# it's not mandatory to set the timezone in localizeddate(). This is done to
23+
avoid errors when the 'intl' PHP extension is not available and the application
24+
is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
25+
<td>{% if post.publishedAt %}{{ post.publishedAt|localizeddate('short', 'short', null, 'UTC') }}{% endif %}</td>
2326
<td>
2427
<div class="item-actions">
2528
<a href="{{ path('admin_post_show', { id: post.id }) }}" class="btn btn-sm btn-default">

app/Resources/views/admin/blog/show.html.twig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
</tr>
2222
<tr>
2323
<th>{{ 'label.published_at'|trans }}</th>
24-
<td><p>{{ post.publishedAt|localizeddate('long', 'medium') }}</p></td>
24+
{# it's not mandatory to set the timezone in localizeddate(). This is done to
25+
avoid errors when the 'intl' PHP extension is not available and the application
26+
is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
27+
<td><p>{{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}</p></td>
2528
</tr>
2629
</tbody>
2730
</table>

app/Resources/views/blog/post_show.html.twig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
<div class="row post-comment">
3333
<h4 class="col-sm-3">
3434
<strong>{{ comment.authorEmail }}</strong> {{ 'post.commented_on'|trans }}
35-
<strong>{{ comment.publishedAt|localizeddate('medium', 'short') }}</strong>
35+
{# it's not mandatory to set the timezone in localizeddate(). This is done to
36+
avoid errors when the 'intl' PHP extension is not available and the application
37+
is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
38+
<strong>{{ comment.publishedAt|localizeddate('medium', 'short', null, 'UTC') }}</strong>
3639
</h4>
3740
<div class="col-sm-9">
3841
{{ comment.content|md2html }}

0 commit comments

Comments
 (0)