[英]How can I modify my Ghost.org blog's date format
My Ghost.org blog displays dates as: 我的Ghost.org博客显示日期为:
04 Nov 2013 2013年11月4日
This is controlled in content\\themes\\{theme-name}\\post.hbs
via: 这在content\\themes\\{theme-name}\\post.hbs
通过以下方式控制:
<time datetime="{{date format="YYYY-MM-DD"}}">
{{date format='DD MMM YYYY'}}
</time>
I want this changed to a different format, like Wednesday, 4th November 2013
, how can I do this? 我希望将其更改为不同的格式,例如Wednesday, 4th November 2013
我该怎么做?
Ghost uses Moment.js to output dates. Ghost使用Moment.js输出日期。
From their display format documentation we can determine that: 从他们的显示格式文档中我们可以确定:
dddd
can be used to output the full day name; dddd
可用于输出全天名称; MMMM
can be used to output the full month name; MMMM
可用于输出完整的月份名称; Do
can be used to output the date in 1st 2nd 3rd 4th...
format; Do
可用于输出日期1st 2nd 3rd 4th...
格式; YYYY
can be used to output the full year number. YYYY
可用于输出全年数字。 From this we can craft our desired date format in content\\themes\\{theme-name}\\post.hbs
using: 从这里我们可以使用以下content\\themes\\{theme-name}\\post.hbs
在content\\themes\\{theme-name}\\post.hbs
制作我们想要的日期格式:
<time datetime="{{date format="YYYY-MM-DD"}}">
{{date format='dddd, MMMM Do YYYY'}}
</time>
Wednesday, 4th November 2013 2013年11月4日星期三
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.