Page MenuHomePhabricator

HTMLDateTimeField should leave blank input untouched
Closed, ResolvedPublic

Description

If you use an HTMLDateTimeField form element in a form, leave it blank and submit the form, it will replace the blank value with today's date.

That is presumptuous. If it is a required field, assuming a value for it refutes the purpose of making it required. In one case (see c/315516) it even causes other validation checks to fail.

Instead, if the input is blank, the object's value should also remain blank. It should be left for the code that uses this element to decide what to do with a blank value.