Page MenuHomePhabricator

mw.widgets.DateInputWidget / HTMLForm 'date' field does not support min/max
Open, Needs TriagePublic

Description

mw.widgets.DateInputWidget and HTMLForm 'date' field does not support the 'min'/'max' options. HTMLForm 'datetime' field supports it by using the DateTimeInputWidget.

Instead, DateInputWidget supports 'mustBeAfter'/'mustBeBefore' options, which are similar but worse – I think it's less intuitive, and inconsistent with a HTML <input type=date>. (The valid values with min/max include the specified value, but with mustBeAfter/mustBeBefore they exlude it.)

I think ideally we should resolve this by deprecating mustBeAfter/mustBeBefore in DateInputWidget, and instead adding support for min/max there.