Добавлена возможность оставить пустое поле даты

This commit is contained in:
Andrey Pokidov
2020-02-25 17:37:24 +07:00
parent 9eb6cfb1ec
commit 8fe52a2a19
5 changed files with 20 additions and 12 deletions

View File

@@ -856,7 +856,10 @@ class SmartDateField
this._field.addEventListener('blur', function () {
_this.correctValue(true);
_this.returnLastCorrectValue();
if (!_this._isEmptyValue(_this._field.value)) {
_this.returnLastCorrectValue();
}
});
}
@@ -898,7 +901,7 @@ class SmartDateField
return;
}
this._setValueToFieled(parsedValue);
this._setValueToField(parsedValue);
}
setValue(value)
@@ -931,7 +934,7 @@ class SmartDateField
return this._formatter.getCorrectedValue();
}
_setValueToFieled(newValue)
_setValueToField(newValue)
{
let position = this._field.selectionStart;
let isAtEnd = (position === this._field.value.length);

File diff suppressed because one or more lines are too long