|
@@ -132,8 +132,10 @@ export default defineComponent({
|
|
|
// 上一月
|
|
|
if (this.arrowStatus) return
|
|
|
const tempDate = dayjs(this.currentDate).subtract(1, 'month')
|
|
|
+ // console.log(dayjs(tempDate).format('YYYY-MM-DD HH:mm:ss'), 'tempDate')
|
|
|
this._monthChange(tempDate)
|
|
|
// this._dayChange(this.minDate)
|
|
|
+ // console.log(dayjs(this.minDate).format('YYYY-MM-DD HH:mm:ss'), 'this.minDate')
|
|
|
this.prevMonth && this.prevMonth(this.minDate)
|
|
|
},
|
|
|
onNextMonth() {
|
|
@@ -146,8 +148,12 @@ export default defineComponent({
|
|
|
_monthChange(date: any) {
|
|
|
// 月份改变
|
|
|
// 需要判断是否是当月,需要单独处理最小时间
|
|
|
- const currentMinDate = dayjs().add(1, 'day').toDate()
|
|
|
+ const currentMinDate = dayjs().toDate()
|
|
|
const monthMinDate = date.startOf('month').toDate()
|
|
|
+ // console.log(date.startOf('month').format('YYYY-MM-DD HH:mm:ss'), 'temp ----- date')
|
|
|
+ // console.log(dayjs(date).format('YYYY-MM-DD HH:mm:ss'), 'date')
|
|
|
+ // console.log(dayjs(currentMinDate).format('YYYY-MM-DD HH:mm:ss'), 'currentMinDate')
|
|
|
+ // console.log(dayjs(monthMinDate).format('YYYY-MM-DD HH:mm:ss'), 'monthMinDate')
|
|
|
this.minDate = dayjs(currentMinDate).isAfter(monthMinDate) ? currentMinDate : monthMinDate
|
|
|
this.maxDate = date.endOf('month').toDate()
|
|
|
this.currentDate = date.toDate()
|