Skip to content

Datepicker: Add the ability to clear the date input

The problem

GlDatePicker doesn't support clearing the selected date.

After selecting a date GlDatePicker doesn't support clearing the date value.

Clearing the date is essential on forms where the date can default to null.

Potential solutions

  1. Fire a input on keydown.enter with the input's new date or null value. Preferred because it allows for text edits.

  2. Add a UI element, eg x, to the input or datepicker that clears the selected date. Seems like a good quality of life impreovement.

Edited by Jiaan Louw