Добавлена возможность оставить пустое поле даты
This commit is contained in:
@@ -950,7 +950,9 @@ function () {
|
|||||||
this._field.addEventListener('blur', function () {
|
this._field.addEventListener('blur', function () {
|
||||||
_this.correctValue(true);
|
_this.correctValue(true);
|
||||||
|
|
||||||
_this.returnLastCorrectValue();
|
if (!_this._isEmptyValue(_this._field.value)) {
|
||||||
|
_this.returnLastCorrectValue();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -1005,7 +1007,7 @@ function () {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._setValueToFieled(parsedValue);
|
this._setValueToField(parsedValue);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "setValue",
|
key: "setValue",
|
||||||
@@ -1037,8 +1039,8 @@ function () {
|
|||||||
return this._formatter.getCorrectedValue();
|
return this._formatter.getCorrectedValue();
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "_setValueToFieled",
|
key: "_setValueToField",
|
||||||
value: function _setValueToFieled(newValue) {
|
value: function _setValueToField(newValue) {
|
||||||
var position = this._field.selectionStart;
|
var position = this._field.selectionStart;
|
||||||
var isAtEnd = position === this._field.value.length;
|
var isAtEnd = position === this._field.value.length;
|
||||||
this._field.value = newValue;
|
this._field.value = newValue;
|
||||||
|
2
es5/smart-date.min.js
vendored
2
es5/smart-date.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -856,7 +856,10 @@ class SmartDateField
|
|||||||
|
|
||||||
this._field.addEventListener('blur', function () {
|
this._field.addEventListener('blur', function () {
|
||||||
_this.correctValue(true);
|
_this.correctValue(true);
|
||||||
_this.returnLastCorrectValue();
|
|
||||||
|
if (!_this._isEmptyValue(_this._field.value)) {
|
||||||
|
_this.returnLastCorrectValue();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -898,7 +901,7 @@ class SmartDateField
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._setValueToFieled(parsedValue);
|
this._setValueToField(parsedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
setValue(value)
|
setValue(value)
|
||||||
@@ -931,7 +934,7 @@ class SmartDateField
|
|||||||
return this._formatter.getCorrectedValue();
|
return this._formatter.getCorrectedValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
_setValueToFieled(newValue)
|
_setValueToField(newValue)
|
||||||
{
|
{
|
||||||
let position = this._field.selectionStart;
|
let position = this._field.selectionStart;
|
||||||
let isAtEnd = (position === this._field.value.length);
|
let isAtEnd = (position === this._field.value.length);
|
||||||
|
2
es6/smart-date.min.js
vendored
2
es6/smart-date.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -142,7 +142,10 @@ class SmartDateField
|
|||||||
|
|
||||||
this._field.addEventListener('blur', function () {
|
this._field.addEventListener('blur', function () {
|
||||||
_this.correctValue(true);
|
_this.correctValue(true);
|
||||||
_this.returnLastCorrectValue();
|
|
||||||
|
if (!_this._isEmptyValue(_this._field.value)) {
|
||||||
|
_this.returnLastCorrectValue();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +187,7 @@ class SmartDateField
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._setValueToFieled(parsedValue);
|
this._setValueToField(parsedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
setValue(value)
|
setValue(value)
|
||||||
@@ -217,7 +220,7 @@ class SmartDateField
|
|||||||
return this._formatter.getCorrectedValue();
|
return this._formatter.getCorrectedValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
_setValueToFieled(newValue)
|
_setValueToField(newValue)
|
||||||
{
|
{
|
||||||
let position = this._field.selectionStart;
|
let position = this._field.selectionStart;
|
||||||
let isAtEnd = (position === this._field.value.length);
|
let isAtEnd = (position === this._field.value.length);
|
||||||
|
Reference in New Issue
Block a user