Добавлена возможность оставить пустое поле даты
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user