YearPicker
A panel that displays a grid of 12 years and lets the user pick one. Navigate between year ranges using the built-in previous/next buttons in the toolbar. The startYear config sets the first year of the displayed range, and the year property reflects the current selection. The select event fires when the user picks a year.
const yearPicker = new YearPicker({
year : 2025,
appendTo : document.body,
onSelect({ value }) {
console.log('Selected year:', value);
}
});
Useful configs and events
| Config / Event | Description |
|---|---|
| startYear | First year displayed in the 12-year range |
| year | The initially selected year |
| tbar | Top toolbar with navigation buttons and title |
| select | Fired when a year is selected |
See also
- MonthPicker - Month selection panel
- DatePicker - Full date picker with day/month/year navigation
No results
Configs
Configs are options you supply in a configuration object when creating an instance of this classProperties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of YearPicker class, or subclass thereof.
-
The ending year displayed in the widget.
-
The starting year displayed in the widget.
Has a corresponding startYear config.
-
The currently selected year.
-
The currently selected year.
Has a corresponding year config.
-
Identifies an object as an instance of YearPicker class, or subclass thereof.