Discard for DateField when the data source contains null (#8069)
Earlier discard did not work (#8069) if the data source
contained null and the user entered an invalid value for date fields.
The discard logic has been changed such that the error indicators and
internal state of the date field is cleared also if the value entered by
the user is invalid and the data source is null.
attach() updates the value from the data source in the same way as
discard. The old logic in attach is retained.