iblh / hexo-theme-material

Material Design theme for hexo.
https://iblh.github.io/material-demo/
GNU General Public License v3.0
4.03k stars 564 forks source link

日期格式没有使用 _config.yml 中的 date_format #527

Open ysc3839 opened 7 years ago

ysc3839 commented 7 years ago

I certify that I have first consulted (check all with "x")

我确认我已经查看了 (使用 "x" 选择)


I'm submitting a (check one with "x")

我正在申请 (使用 "x" 选择)

日期格式没有使用 _config.yml 中的 date_format. https://github.com/viosey/hexo-theme-material/blob/047837bc1081cbe7e047c935b7f905a51fe7f309/layout/_partial/Paradox-post_entry.ejs#L41 https://github.com/viosey/hexo-theme-material/blob/047837bc1081cbe7e047c935b7f905a51fe7f309/layout/_partial/Isolation-post_entry.ejs#L61 https://github.com/viosey/hexo-theme-material/blob/047837bc1081cbe7e047c935b7f905a51fe7f309/layout/_partial/Paradox-post-info.ejs#L10 https://github.com/viosey/hexo-theme-material/blob/047837bc1081cbe7e047c935b7f905a51fe7f309/layout/_widget/page-timeline.ejs#L399 'MMM DD, YYYY' -> config.date_format

neoFelhz commented 7 years ago

我们为了显示效果,没有使用 config.date_format

ysc3839 commented 7 years ago

@neoFelhz 希望能给用户自定义的选项

huangjj27 commented 7 years ago

@ysc3839 请在hexo站点配置文件中配置时间格式.

# hexo_server/_config.yml line 51

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
ysc3839 commented 7 years ago

@huangjj27 上面的源代码中没有使用 _config.yml 中的 date_format

huangjj27 commented 7 years ago

@ysc3839 也许是我理解错你的意思了, 你是指最后日期并没有使用hexo站点的_config.yml里面设置的时间配置? 如果是这样, 那么前文中也已经解释了为什么不能自定义了:

我们为了显示效果,没有使用 config.date_format 。

ysc3839 commented 7 years ago

@huangjj27 是的