var formatNumber = function (n) {
n = n.toString()
return n[1] ? n : '0' + n
}
/**
* 将时间戳(1570550400)格式转为 yyyy-MM-dd格式
*/
var formatDate = function (str) {
// var date = getDate(datetime);
var n = parseInt(str)*1000;
var date = getDate(n);
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
return [year, month, day].map(formatNumber).join('-');
// return
}
module.exports = {
formatDate: formatDate
}
filter.wxsvar formatNumber = function (n) { n = n.toString() return n[1] ? n : '0' + n}/** * 将时间戳(1570550400)格式转为 yyyy-MM-dd格式 */var formatDate = function (str) { // var date = getDate(datetime); var n = parseInt(str)*1000; var date = get.