html日期只显示7天,vue+elementui 只能选7天内的日期
html:
查詢時間
至
js:
data() {
const _this = this;
const dateScope = 7 * 24 * 3600 * 1000;
return {
pickerStart: {
disabledDate(time) {
const endLen = _this.endDate;
if (endLen === 0 || endLen == "" || endLen === null) {
return time.getTime() > Date.now();
}
const date = new Date(endLen).getTime();
// 返回小于7天的,或都返回當前時間減去7天的
return time.getTime() > date || time.getTime() < date - dateScope;
}
},
pickerEnd: {
disabledDate(time) {
const startLen = _this.startDate;
if (startLen === 0 || startLen == "" || startLen === null) {
return time.getTime() > Date.now();
}
const date = new Date(startLen).getTime();
return time.getTime() < date || time.getTime() > date + dateScope;
}
},
}
總結
以上是生活随笔為你收集整理的html日期只显示7天,vue+elementui 只能选7天内的日期的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: 用孩子名字存钱的利弊,存款所有权归孩子吗
 - 下一篇: 英特网rst服务器未在运行,技术员示范w