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

master
Andrey Pokidov 5 years ago
parent 9eb6cfb1ec
commit 8fe52a2a19

@ -950,7 +950,9 @@ function () {
this._field.addEventListener('blur', function () {
_this.correctValue(true);
_this.returnLastCorrectValue();
if (!_this._isEmptyValue(_this._field.value)) {
_this.returnLastCorrectValue();
}
});
}
}, {
@ -1005,7 +1007,7 @@ function () {
return;
}
this._setValueToFieled(parsedValue);
this._setValueToField(parsedValue);
}
}, {
key: "setValue",
@ -1037,8 +1039,8 @@ function () {
return this._formatter.getCorrectedValue();
}
}, {
key: "_setValueToFieled",
value: function _setValueToFieled(newValue) {
key: "_setValueToField",
value: function _setValueToField(newValue) {
var position = this._field.selectionStart;
var isAtEnd = position === this._field.value.length;
this._field.value = newValue;

File diff suppressed because one or more lines are too long

@ -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

@ -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);

Loading…
Cancel
Save