|
@@ -316,8 +316,8 @@ export default {
|
|
|
handleTimePick(value, visible, first) {
|
|
|
if (isDate(value)) {
|
|
|
const newDate = this.value
|
|
|
- ? modifyTime(this.value, value.getHours(), value.getMinutes(), value.getSeconds())
|
|
|
- : modifyWithTimeString(this.getDefaultValue(), this.defaultTime);
|
|
|
+ ? modifyTime(this.value, value.getHours(), value.getMinutes(), value.getSeconds())
|
|
|
+ : modifyWithTimeString(this.getDefaultValue(), this.defaultTime);
|
|
|
this.date = newDate;
|
|
|
this.emit(this.date, true);
|
|
|
} else {
|
|
@@ -349,8 +349,8 @@ export default {
|
|
|
handleDatePick(value) {
|
|
|
if (this.selectionMode === 'day') {
|
|
|
let newDate = this.value
|
|
|
- ? modifyDate(this.value, value.getFullYear(), value.getMonth(), value.getDate())
|
|
|
- : modifyWithTimeString(value, this.defaultTime);
|
|
|
+ ? modifyDate(this.value, value.getFullYear(), value.getMonth(), value.getDate())
|
|
|
+ : modifyWithTimeString(value, this.defaultTime);
|
|
|
// change default time while out of selectableRange
|
|
|
if (!this.checkDateWithinRange(newDate)) {
|
|
|
newDate = modifyDate(this.selectableRange[0][0], value.getFullYear(), value.getMonth(), value.getDate());
|
|
@@ -394,8 +394,8 @@ export default {
|
|
|
// value were emitted in handle{Date,Time}Pick, nothing to update here
|
|
|
// deal with the scenario where: user opens the picker, then confirm without doing anything
|
|
|
const value = this.value
|
|
|
- ? this.value
|
|
|
- : modifyWithTimeString(this.getDefaultValue(), this.defaultTime);
|
|
|
+ ? this.value
|
|
|
+ : modifyWithTimeString(this.getDefaultValue(), this.defaultTime);
|
|
|
this.date = new Date(value); // refresh date
|
|
|
this.emit(value);
|
|
|
}
|
|
@@ -492,9 +492,9 @@ export default {
|
|
|
|
|
|
isValidValue(value) {
|
|
|
return value && !isNaN(value) && (
|
|
|
- typeof this.disabledDate === 'function'
|
|
|
- ? !this.disabledDate(value)
|
|
|
- : true
|
|
|
+ typeof this.disabledDate === 'function'
|
|
|
+ ? !this.disabledDate(value)
|
|
|
+ : true
|
|
|
) && this.checkDateWithinRange(value);
|
|
|
},
|
|
|
|
|
@@ -506,8 +506,8 @@ export default {
|
|
|
|
|
|
checkDateWithinRange(date) {
|
|
|
return this.selectableRange.length > 0
|
|
|
- ? timeWithinRange(date, this.selectableRange, this.format || 'HH:mm:ss')
|
|
|
- : true;
|
|
|
+ ? timeWithinRange(date, this.selectableRange, this.format || 'HH:mm:ss')
|
|
|
+ : true;
|
|
|
}
|
|
|
},
|
|
|
|