Skip to content

Commit 8642b4f

Browse files
committed
Format date string using date: "%Y-%m-%d"
Signed-off-by: Jiang Xin <[email protected]>
1 parent bb57b30 commit 8642b4f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

_layouts/post.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: master
33
---
44
<div class='post'>
5-
<span class='date'>{{page.date | date_to_string}}</span>
5+
<span class='date'>{{page.date | date: "%Y-%m-%d"}}</span>
66
<h1><a href='{{page.url}}'>{{page.title}}</a></h1>
77
<div class='body'>{{ content }}</div>
88
</div>
@@ -13,7 +13,7 @@ <h3>Related Posts</h3>
1313
{% for post in site.related_posts limit:3 %}
1414
<tr>
1515
<th><a href='{{ post.url }}'>{{ post.title }}</a></th>
16-
<td>{{ post.date | date_to_string }}</td>
16+
<td>{{ post.date | date: "%Y-%m-%d"}}</td>
1717
<td><a href='{{post.url}}#disqus_thread'>Comments</a></td>
1818
</tr>
1919
{% endfor %}

blog.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% for post in site.posts %}
1010
{% if forloop.index < page.full_posts %}
1111
<div class='post'>
12-
<span class='date'>{{post.date | date_to_string}}</span>
12+
<span class='date'>{{post.date | date: "%Y-%m-%d"}}</span>
1313
<h1><a href='{{post.url}}'>{{post.title}}</a></h1>
1414
<div class='body'>{{post.content}}</div>
1515
<a href='{{post.url}}#disqus_thread'>View Comments</a>
@@ -21,7 +21,7 @@ <h3>更多博客</h3>
2121
{% endif %}
2222
<tr>
2323
<th><a href='{{ post.url }}'>{{ post.title }}</a></th>
24-
<td>{{ post.date | date_to_string }}</td>
24+
<td>{{ post.date | date: "%Y-%m-%d"}}</td>
2525
<td><a href='{{post.url}}#disqus_thread'>Comments</a></td>
2626
</tr>
2727
{% endif %}

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h2><a href='atom.xml' class='float-right'
1111

1212
{% for post in site.posts limit:page.full_posts %}
1313
<div class='post'>
14-
<span class='date'>{{post.date | date_to_string}}</span>
14+
<span class='date'>{{post.date | date: "%Y-%m-%d"}}</span>
1515
<h1><a href='{{post.url}}'>{{post.title}}</a></h1>
1616
<div class='body'>{{post.content}}</div>
1717
<a href='{{post.url}}#disqus_thread'>View Comments</a>

0 commit comments

Comments
 (0)