Consider min and max date when initializing view date

pull/1792/head
Cagatay Civici 2021-11-17 17:29:26 +03:00
parent 5e8e1e799d
commit f5f07c88f6
1 changed files with 13 additions and 1 deletions

View File

@ -2194,7 +2194,19 @@ export default {
propValue = propValue[0];
}
return propValue || new Date();
if (propValue) {
return propValue;
}
else {
let today = new Date();
if (this.maxDate && this.maxDate < today) {
return this.maxDate;
}
if (this.minDate && this.minDate > today) {
return this.minDate;
}
return today;
}
},
inputFieldValue() {
return this.formatValue(this.modelValue);