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

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

No files matched your search

+6 -3
View File
@@ -142,7 +142,10 @@ class SmartDateField
this._field.addEventListener('blur', function () {
_this.correctValue(true);
_this.returnLastCorrectValue();
if (!_this._isEmptyValue(_this._field.value)) {
_this.returnLastCorrectValue();
}
});
}
@@ -184,7 +187,7 @@ class SmartDateField
return;
}
this._setValueToFieled(parsedValue);
this._setValueToField(parsedValue);
}
setValue(value)
@@ -217,7 +220,7 @@ class SmartDateField
return this._formatter.getCorrectedValue();
}
_setValueToFieled(newValue)
_setValueToField(newValue)
{
let position = this._field.selectionStart;
let isAtEnd = (position === this._field.value.length);