fix: 跨月签到记录不显示的问题

This commit is contained in:
kuaifan 2023-02-01 12:14:12 +08:00
parent 7109eb0238
commit 16ff7380a5

View File

@ -173,11 +173,14 @@ export default {
latelyFormat(data) {
const time = $A.Time();
const Ym = $A.formatDate("Ym", time)
this.latelyData = [];
for (let i = 0; i < 5; i++) {
const ymd = $A.formatDate("Y-m-d", time - i * 86400)
const item = data.find(({date}) => date == ymd) || {date: ymd, section: []}
this.latelyData.push(item)
if (Ym == $A.formatDate("Ym", time - i * 86400)) {
const ymd = $A.formatDate("Y-m-d", time - i * 86400)
const item = data.find(({date}) => date == ymd) || {date: ymd, section: []}
this.latelyData.push(item)
}
}
},