| | |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | value-format="yyyy-MM-dd HH" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | end-placeholder="结束日期" |
| | | :picker-options="pickerOptions" |
| | | > |
| | |
| | | // 最大时间 最小时间 |
| | | this.timeOne = minDate.getTime() // 当选一个日期时 就是最小日期 |
| | | // // 如何你选择了两个日期了,就把那个变量置空 |
| | | |
| | | if (maxDate) this.timeOne = '' |
| | | |
| | | }, |
| | | disabledDate: time => { |
| | | if (this.timeOne) { |
| | | const WEEK = 7 * 24 * 3600 * 1000 -1 // 这里乘以6相当于 限制7天以内 |
| | | const minTime = this.timeOne // 七天之前 |
| | | const WEEK = 7 * 24 * 3600 * 1000 - 1 // 这里乘以6相当于 限制7天以内 |
| | | const minTime = this.timeOne // 七天之前 |
| | | const maxTime = this.timeOne + WEEK // 七天之后 |
| | | return time.getTime() < minTime || time.getTime() > maxTime || time.getTime() > new Date() |
| | | } else { |