<div class="input-box f-left birthday-picker-box">
<span>生日</span>
<el-date-picker
v-model="birthdayStart"
name="birthdayStart"
format="MM-dd"
value-format="timestamp"
type="date"
placeholder=""
:editable="inputEditable"
:picker-options="pickerBirthdayBefore"
>
</el-date-picker>
<div class="line f-left">-</div>
</div>
data() {
return {
pickerBirthdayBefore: {
//disabledDate通常是一个函数,
disabledDate: time => { // time.getTime() >= beginDateVal false 可用,true 不可用
let beginDateVal = this.birthdayEnd;
if (beginDateVal) {
return time.getTime() >= beginDateVal; //开始时间小于结束时间
return time.getTime() <= beginDateVal || time.getTime() > Date.now(); //结束时间大于开始时间且小于当前时间
return time.getTime() >= Date.now()-8.64e7 //今天及以后的日期都不能选
}
}
},