Closed hartwoolery closed 7 years ago
+1 here.
This bug seems to be located in the valueOut
function of the bootstrap-datepicker
input type definition in autoform-bs-datepicker.js
.
There's a check here on this.val()
so the function return only if field value is not falsy.
Here is the actual function
valueOut: function () {
if (this.val()) {
var val = this.datepicker('getUTCDate');
return (val instanceof Date) ? val : this.val();
}
}
Obviously, an empty string will never call the return statement. I changed it to
valueOut: function () {
var val;
if (this.val()) {
val = this.datepicker('getUTCDate');
}
return (val instanceof Date) ? val : this.val();
}
to return an empty string when needed.
+1 ran into this same bug. @aldeed can you merge and release #27?
+1 @aldeed
@aldeed We also have the same issue with datepicker, when is the fix going to be merged & released?
When I log the modifier before submit should show {$unset:{my_date_field:""}} but just ignores the field, retaining the previous value.