dayClick事件怎样判断选中的日期在当前月历中是本月还是上或下个月的
RockYuan opened this issue · 1 comments
RockYuan commented
RockYuan commented
好吧,自已来判断吧
// 判断选中日期是本月,上月还是下月
dayOnMonth : function(month){
let dayOnMonth = 'current'
if (this.data.month == 1 && month == 12) {
dayOnMonth = 'prev'
}
else if (this.data.month == 12 && month == 1) {
dayOnMonth = 'next'
}
else if (month > this.data.month) {
dayOnMonth = 'next'
}
else if (month < this.data.month) {
dayOnMonth = 'prev'
}
return dayOnMonth
}