Updates can clear date and date range inputs

This commit is contained in:
Gábor Csárdi
2016-08-23 20:42:33 +01:00
parent a1b5846b29
commit 097d901191
6 changed files with 28 additions and 10 deletions

View File

@@ -14,6 +14,12 @@ $.extend(dateInputBinding, {
},
// value must be an unambiguous string like '2001-01-01', or a Date object.
setValue: function(el, value) {
// R's NA, which is null here will remove current value
if (value === null) {
$(el).find('input').val('').datepicker('update');
return;
}
var date = this._newDate(value);
// If date is invalid, do nothing
if (isNaN(date))