Commit 9462befa authored by shangbj's avatar shangbj

增加扩展

parent 8ef156cd
'use strict';
const moment = require('moment');
module.exports = {
formatTime(param) {
// 格式化日期
return moment(param).format('YYYY-MM-DD H:mm');
},
};
......@@ -15,6 +15,8 @@
<%for(var i=0;i<list.length;i++){%>
<li>
<%=list[i].title%>
<span style="color:#ccc;">
<%=helper.formatTime(list[i].postdate)%></span>
</li>
<%}%>
</ul>
......
......@@ -6,7 +6,8 @@
"dependencies": {
"egg": "^2.2.1",
"egg-scripts": "^2.5.0",
"egg-view-ejs": "^2.0.0"
"egg-view-ejs": "^2.0.0",
"moment": "^2.22.2"
},
"devDependencies": {
"autod": "^3.0.1",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment