filter.wxs 438 B

123456789101112131415161718
  1. var formatNumber = function (n) {
  2. n = n.toString()
  3. return n[1] ? n : '0' + n
  4. }
  5. /**
  6. * 将时间戳(1570550400)格式转为 yyyy-MM-dd格式
  7. */
  8. var formatDate = function (datetime) {
  9. var time = datetime * 1
  10. var date = getDate(time);
  11. var year = date.getFullYear();
  12. var month = date.getMonth() + 1;
  13. var day = date.getDate();
  14. return year + '年' + month + '月' + day + '日';
  15. }
  16. module.exports = {
  17. formatDate: formatDate
  18. }