| | |
| | | } |
| | | |
| | | if (newV && oldV) { |
| | | const newDate = dayjs(newV); |
| | | const newDate = dayjs(newV); |
| | | const oldDate = dayjs(oldV); |
| | | |
| | | // 格式化为 YYYY-MM-DD HH:mm:ss |
| | | const newDateStr = newDate.format('YYYY-MM-DD HH:mm:ss'); |
| | | const oldDateStr = oldDate.format('YYYY-MM-DD HH:mm:ss'); |
| | | params. |
| | | console.log('新日期:', newDateStr, '旧日期:', oldDateStr); |
| | | |
| | | if (newDate.isBefore(oldDate, 'month')) { |
| | | console.log('点击了上个月',newDateStr); |
| | | console.log('点击了上个月'); |
| | | } else if (newDate.isAfter(oldDate, 'month')) { |
| | | console.log('点击了下个月',newDateStr); |
| | | console.log('点击了下个月'); |
| | | } |
| | | } |
| | | }, |
| | |
| | | }; |
| | | // 获取对应日期的事件 |
| | | const getEvents = dateString => { |
| | | // console.log('000',dateString); |
| | | // console.log('000',dateString); |
| | | |
| | | return events.value[dateString] || []; |
| | | }; |