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 @@ ...@@ -15,6 +15,8 @@
<%for(var i=0;i<list.length;i++){%> <%for(var i=0;i<list.length;i++){%>
<li> <li>
<%=list[i].title%> <%=list[i].title%>
<span style="color:#ccc;">
<%=helper.formatTime(list[i].postdate)%></span>
</li> </li>
<%}%> <%}%>
</ul> </ul>
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"dependencies": { "dependencies": {
"egg": "^2.2.1", "egg": "^2.2.1",
"egg-scripts": "^2.5.0", "egg-scripts": "^2.5.0",
"egg-view-ejs": "^2.0.0" "egg-view-ejs": "^2.0.0",
"moment": "^2.22.2"
}, },
"devDependencies": { "devDependencies": {
"autod": "^3.0.1", "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