After clicking the clear button, when we reopen the date picker, the original selected ranged is not cleared. Although the model has been reset to null, the startDate and endDate in DateRangePicker is not updated.
The issue seems to be related to the code:
_setDatePoint = function(setter) {
return function(newValue) {
if (_picker && newValue) { ===> When the newValue is null, it will not be set to the Bootstrap DataRangePicker
return setter(moment(newValue));
}
};
};
_setStartDate = _setDatePoint(function(m) {
if (_picker.endDate < m) {
_picker.setEndDate(m);
}
opts.startDate = m;
return _picker.setStartDate(m);
});
After clicking the clear button, when we reopen the date picker, the original selected ranged is not cleared. Although the model has been reset to null, the startDate and endDate in DateRangePicker is not updated.
The issue seems to be related to the code:
_setDatePoint = function(setter) { return function(newValue) { if (_picker && newValue) { ===> When the newValue is null, it will not be set to the Bootstrap DataRangePicker return setter(moment(newValue)); } }; }; _setStartDate = _setDatePoint(function(m) { if (_picker.endDate < m) { _picker.setEndDate(m); } opts.startDate = m; return _picker.setStartDate(m); });