8000 feature #104 Display the comment's datetime localized (javiereguiluz) · SofHad/symfony@07d30c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 07d30c8

Browse files
committed
feature symfony#104 Display the comment's datetime localized (javiereguiluz)
This PR was squashed before being merged into the master branch (closes symfony#104). Discussion ---------- Display the comment's datetime localized This fixes symfony#99 Commits ------- 0318e89 Display the comment's datetime localized
2 parents 00b84af + 0318e89 commit 07d30c8

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<tr>
2020
<td>{{ post.title }}</td>
2121
<td>{{ post.authorEmail }}</td>
22-
<td>{% if post.publishedAt %}{{ post.publishedAt|date('Y-m-d H:i') }}{% endif %}</td>
22+
<td>{% if post.publishedAt %}{{ post.publishedAt|localizeddate('short', 'short') }}{% endif %}</td>
2323
<td>
2424
<div class="item-actions">
2525
<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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</tr>
2222
<tr>
2323
<th>{{ 'label.published_at'|trans }}</th>
24-
<td><p>{{ post.publishedAt|date('Y-m-d H:i:s') }}</p></td>
24+
<td><p>{{ post.publishedAt|localizeddate('long', 'medium') }}</p></td>
2525
</tr>
2626
</tbody>
2727
</table>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
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|date('M jS \\a\\t g:i a') }}</strong>
35+
<strong>{{ comment.publishedAt|localizeddate('medium', 'short') }}</strong>
3636
</h4>
3737
<div class="col-sm-9">
3838
{{ comment.content|md2html }}

app/config/services.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ services:
3030
tags:
3131
- { name: twig.extension }
3232

33+
app.twig.extension_intl:
34+
public: false
35+
class: Twig_Extensions_Extension_Intl
36+
tags:
37+
- { name: twig.extension }
38+
3339
app.controller_listener:
3440
class: AppBundle\EventListener\ControllerListener
3541
arguments: ["@app.twig.source_code_extension"]

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0