-
Notifications
You must be signed in to change notification settings - Fork 75
API Methods
$('.selector').MonthPicker('Clear')
Clears the state of all input and validation warnings.
$('.selector').MonthPicker('ClearAllCallbacks')
Disables all previously assigned event callbacks listed in the Events tab.
$('.selector').MonthPicker('Close')
Closes the month picker if it's already open. You can prevent the menu from closing using the OnBeforeMenuClose event and calling event.preventDefault(). (Added in version 2.5).
$('.selector').Destroy()
Destroys the month picker widget.
$('.selector').MonthPicker('Disable')
Disables the MonthPicker and its associated elements.
$('.selector').MonthPicker('Enable')
Enables the MonthPicker and its associated elements.
$('.selector').MonthPicker('GetSelectedDate')
Returns the selected month as a Date object. (Added in version 2.4)
$('.selector').MonthPicker('GetSelectedMonthYear')
Validates the selected month/year and returns the selected value as a string (for example '1/2015') if it is a valid date. Returns null if there is no valid date, displays an error message if the message is specified, focuses and selects the violating text.
NOTE: This method is not affected by the MonthFormat option.
$('.selector').MonthPicker('GetSelectedMonth')
Returns only the month portion of the selected date as an integer. Returns NaN if there is no valid date.
$('.selector').MonthPicker('GetSelectedYear')
Returns only the year portion of the selected date as an integer. Returns NaN if there is no valid date.
$('.selector').MonthPicker('Open')
Opens the month picker menu and keeps it open if it's already open, see the OnBeforeMenuClose event to prevent the menu from closing on click (or other) events. (Added in version 2.5).
IMPORTANT: If you are Opening or Toggling the menu in response to events like click, mousedown, mouseup, focus etc... The menu will immediately close itself, you can prevent the menu from closing using the OnBeforeMenuClose event (example included) and calling event.preventDefault() for the element triggering the event.
NOTE: It might be possible to prevent the menu from closing by calling event.stopPropagation() in the click event that called the Open method.
However this is not supported and might stop working in future releases if we change the way the plugin handles events. To prevent the menu from hiding use the OnBeforeMenuClose event (example included) and call event.preventDefault() for the element triggering the event.
$('.selector').MonthPicker('Toggle')
Opens the month picker menu or closes the menu if it's already open, see the OnBeforeMenuClose event to prevent the menu from closing on click (or other) events. (Added in version 2.5).
$('.selector').val()
Use jQuery .val() to get the input without any date validation.
$('.selector').MonthPicker('Validate')
Validates the selected month/year and returns the selected value as a Date object if it is a valid date. Returns null if there is no valid date, displays an error message if the message is specified, focuses and selects the violating text. (Added in version 2.4)