<div class="day"
v-for="(day, index) in daysInMonth" :key="index"
@click="monthClick(day, index)"
:class="{ calendarSize: day.clicked }"
>{{ day.title }}</div>
generateCalendar() {
this.currentYear = this.today.getFullYear()
this.currentMonth = this.today.getMonth()
this.currentMonthName = this.today.toLocaleString('default', {
month: 'long',
})
let date = new Date(this.currentYear, this.currentMonth, 1)
this.days = []
while (date.getMonth() === this.currentMonth) {
this.days.push(date.getDate())
date.setDate(date.getDate() + 1)
}
this.days.forEach((item) => {
this.dayDate = {
title: item,
clicked: false,
}
this.daysInMonth.push(this.dayDate)
})
},
monthClick(day, index) {
this.filterVar = []
this.daysInMonth[index].clicked = !this.daysInMonth[index].clicked
this.filterVar.push(day)
this.promptTime = this.promptTime.concat(this.filterVar)
this.promptTime = this.promptTime.filter((item) => item.clicked)
},