Skip to content

Fixed other localizeddate usages to work with the Intl component #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/Resources/views/admin/blog/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
<tr>
<td>{{ post.title }}</td>
<td>{{ post.authorEmail }}</td>
<td>{% if post.publishedAt %}{{ post.publishedAt|localizeddate('short', 'short') }}{% endif %}</td>
{# it's not mandatory to set the timezone in localizeddate(). This is done to
avoid errors when the 'intl' PHP extension is not available and the application
is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
<td>{% if post.publishedAt %}{{ post.publishedAt|localizeddate('short', 'short', null, 'UTC') }}{% endif %}</td>
<td>
<div class="item-actions">
<a href="{{ path('admin_post_show', { id: post.id }) }}" class="btn btn-sm btn-default">
Expand Down
5 changes: 4 additions & 1 deletion app/Resources/views/admin/blog/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
</tr>
<tr>
<th>{{ 'label.published_at'|trans }}</th>
<td><p>{{ post.publishedAt|localizeddate('long', 'medium') }}</p></td>
{# it's not mandatory to set the timezone in localizeddate(). This is done to
avoid errors when the 'intl' PHP extension is not available and the application
is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
<td><p>{{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}</p></td>
</tr>
</tbody>
</table>
Expand Down
5 changes: 4 additions & 1 deletion app/Resources/views/blog/post_show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
<div class="row post-comment">
<h4 class="col-sm-3">
<strong>{{ comment.authorEmail }}</strong> {{ 'post.commented_on'|trans }}
<strong>{{ comment.publishedAt|localizeddate('medium', 'short') }}</strong>
{# it's not mandatory to set the timezone in localizeddate(). This is done to
avoid errors when the 'intl' PHP extension is not available and the application
is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
<strong>{{ comment.publishedAt|localizeddate('medium', 'short', null, 'UTC') }}</strong>
</h4>
<div class="col-sm-9">
{{ comment.content|md2html }}
Expand Down