getweekday(date){
var weekArray = new Array("周日", "周一", "周二", "周三", "周四", "周五", "周六");
var week = weekArray[new Date(date).getDay()];//注意此处必须是先new一个Date
return week;
},
formatDate(date) {
console.log(date)
date = new Date(date);
return `${date.getMonth() + 1}月${date.getDate()}日`;
},
onLoad: function (options) {
this.setData({
date: this.formatDate(new Date()),
week: this.getweekday(new Date())
})
},