Android Studio 4.0 及以上版本技巧及问题总结

时间:2020-08-09 19:10:41   收藏:0   阅读:147
<wxs module="formatTime">
  var formatTimeCoupon = function(times){
    var date = getDate((times*1000));
    var year = date.getFullYear()
    var month = date.getMonth() + 1
    var day = date.getDate()
    month = month > 9 ? month : ‘0‘ + month
    day = day > 9 ? day : ‘0‘ + day
    return year + ‘.‘ + month + ‘.‘ + day
  }
  module.exports = {
    formatTimeCoupon:formatTimeCoupon
  }
</wxs>
<view>有效期至 {{formatTime.formatTimeCoupon(时间戳)}}</view>

注意:没有 new Date()   要用  getDate()

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!