timepicker-ui
4.6.0GitHub
timepicker-ui
Advanced / External API

External API

Drive a picker from your own buttons and code. This page documents @pglejzer/datepicker-ui, the companion of timepicker-ui.

open, setValue, getValue, close

#

The methods of the instance work without any user input. setValue() takes a Date or an ISO string and writes the input text. getValue() returns the committed value, or null.

External API

getValue(): not read yet

import DatepickerUI from "@pglejzer/datepicker-ui";
import "@pglejzer/datepicker-ui/index.css";
const picker = new DatepickerUI("#date");
picker.create();
picker.open();
picker.setValue("2026-03-14");
picker.getValue(); // { value: "2026-03-14", date: Date, formatted: "03/14/2026" }
picker.setValue(null);
picker.close();

Note

setValue() does not emit confirm. The shape of the value has to match calendar.mode, otherwise an error event with the code invalid-date is emitted.
Esc