Skip to content

Commit

Permalink
feature #104 Display the comment's datetime localized (javiereguiluz)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the master branch (closes #104).

Discussion
----------

Display the comment's datetime localized

This fixes #99

Commits
-------

0318e89 Display the comment's datetime localized
  • Loading branch information
javiereguiluz committed Jul 21, 2015
2 parents 00b84af + 0318e89 commit 07d30c8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 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,7 @@
<tr>
<td>{{ post.title }}</td>
<td>{{ post.authorEmail }}</td>
<td>{% if post.publishedAt %}{{ post.publishedAt|date('Y-m-d H:i') }}{% endif %}</td>
<td>{% if post.publishedAt %}{{ post.publishedAt|localizeddate('short', 'short') }}{% endif %}</td>
<td>
<div class="item-actions">
<a href="{{ path('admin_post_show', { id: post.id }) }}" class="btn btn-sm btn-default">
Expand Down
2 changes: 1 addition & 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,7 @@
</tr>
<tr>
<th>{{ 'label.published_at'|trans }}</th>
<td><p>{{ post.publishedAt|date('Y-m-d H:i:s') }}</p></td>
<td><p>{{ post.publishedAt|localizeddate('long', 'medium') }}</p></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 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,7 @@
<div class="row post-comment">
<h4 class="col-sm-3">
<strong>{{ comment.authorEmail }}</strong> {{ 'post.commented_on'|trans }}
<strong>{{ comment.publishedAt|date('M jS \\a\\t g:i a') }}</strong>
<strong>{{ comment.publishedAt|localizeddate('medium', 'short') }}</strong>
</h4>
<div class="col-sm-9">
{{ comment.content|md2html }}
Expand Down
6 changes: 6 additions & 0 deletions app/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ services:
tags:
- { name: twig.extension }

app.twig.extension_intl:
public: false
class: Twig_Extensions_Extension_Intl
tags:
- { name: twig.extension }

app.controller_listener:
class: AppBundle\EventListener\ControllerListener
arguments: ["@app.twig.source_code_extension"]
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 07d30c8

Please sign in to comment.