timepicker-ui
4.6.0GitHub
timepicker-ui
Features / Today and Clear Buttons

Today and Clear Buttons

Add Today and Clear to the footer of the picker. This page documents @pglejzer/datepicker-ui, the companion of timepicker-ui.

Today and Clear

#

ui.todayButton and ui.clearButton are off by default. Their texts are labels.today and labels.clear. Clear empties the value and the input.

Both buttons
import DatepickerUI from "@pglejzer/datepicker-ui";
import "@pglejzer/datepicker-ui/index.css";
new DatepickerUI("#date", {
ui: { todayButton: true, clearButton: true },
}).create();

Keep the typed text

#

Pass { clearInput: false } to ui.clearButton to clear the value but leave the text in the input.

Keep input text
import DatepickerUI from "@pglejzer/datepicker-ui";
import "@pglejzer/datepicker-ui/index.css";
new DatepickerUI("#date", {
ui: { todayButton: true, clearButton: { clearInput: false } },
}).create();
Esc