//筛选本月签到次数
continueDays() {
let days: any = [];
this.selectedLeanth.map((item: any) => {
let r = item.createTime;
r = Foundation.dateFormat(r);
days.push(r);
});
let i = 0;
days.forEach((d: any) => {
let nowDate = new Date();
let dt = new Date(d);
let ret =
nowDate.getFullYear() == dt.getFullYear() &&
nowDate.getMonth() == dt.getMonth();
if (ret) {
i++;
}
});
if(i>1){
this.signtxt = `本月已签到${i}天`;
}else{
this.signtxt = "已签到1天";
}
}
js判断日期对象是否为本月日期
最新推荐文章于 2024-05-17 17:52:06 发布