bug fix: 日历显示错误
This commit is contained in:
parent
d971c0e4b6
commit
6c5e45f7c7
@ -44,14 +44,16 @@ export default {
|
||||
methods: {
|
||||
// 初始化日历样式
|
||||
generateMonth() {
|
||||
const days = Math.floor((this.activityData.endTime - this.activityData.startTime) /ONE_DAY)
|
||||
let beginTime = new Date(this.activityData.startTime)
|
||||
let endTime = new Date(this.activityData.endTime)
|
||||
let i = 0
|
||||
const now = getDayBegin(new Date())
|
||||
for(let i = 0; i < days; i++ ){
|
||||
while(beginTime <= endTime) {
|
||||
let current = i * ONE_DAY + this.activityData.startTime
|
||||
if(current <= this.activityData.endTime) {
|
||||
const type = current < now ? -1 : 0
|
||||
this.current.push({day: formatDate(new Date(current)), type, time: current, index: i + 1})
|
||||
}
|
||||
beginTime = new Date(current)
|
||||
const type = current < now ? -1 : 0
|
||||
this.current.push({day: formatDate(new Date(current)), type, time: current, index: i + 1})
|
||||
i++
|
||||
}
|
||||
this.getCheckInit()
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user