v7.3.0

MonthPicker
Widget

A panel that displays all 12 months of the year and lets the user pick one. The month property reflects and controls the selected month (0-based, 0–11). The select event fires when the user picks a month, and titleClick fires when the panel's title (showing the current year) is clicked — useful for navigating to a YearPicker.

const monthPicker = new MonthPicker({
    month    : new Date().getMonth(),
    appendTo : document.body,
    onSelect({ value }) {
        console.log('Selected month:', value);
    }
});

Useful configs and events

Config / Event Description
month The selected month (0-based, 0–11)
select Fired when a month is selected
titleClick Fired when the panel title is clicked

See also

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • The month to use as the selected month (zero-based, 0-11). Defaults to the current month.

    Has a corresponding runtime month property.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • The month to use as the selected month (zero-based, 0-11). Defaults to the current month.

    Has a corresponding month config.

  • isMonthPicker : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of MonthPicker class, or subclass thereof.

Events

Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

Event handlers

Event handlers are callbacks called as a result of certain actions in this class
type: monthpicker

Source path

Core/widget/MonthPicker.js

Contents