timepicker-ui
4.6.0GitHub
timepicker-ui
Features / Year Picker

Year Picker

Pick a year instead of a day. This page documents @pglejzer/datepicker-ui, the companion of timepicker-ui.

Year precision

#

Set calendar.precision to "year". The picker shows a grid of years and a pick selects the whole year. DateValue.value is YYYY.

Year precision
import DatepickerUI from "@pglejzer/datepicker-ui";
import "@pglejzer/datepicker-ui/index.css";
new DatepickerUI("#date", {
calendar: { precision: "year" },
}).create();

Note

The years on offer come from ui.yearRange (100 years back and 20 ahead by default) and from minDate and maxDate.
Esc