Skip to content

MaxMonth Option

Ryan Segura edited this page Feb 8, 2017 · 6 revisions

Type: Date or Number or String
Default: null
Since: 2.6
The maximum selectable month. When set to null, there is no max.

Multiple types supported:

  • Date: A Date object containing the maximum month.
  • Number: A number of months from today. For example 2 represents two months from today and -1 represents the last month.
  • String: A string in the format defined by the MonthFormat option, or a relative month.

    Relative months must contain value and period pairs; valid periods are "m" for months, and "y" for years. For example, "+1y +3m" represents one year and three months from today.

Disables months beyond the max upon init.

$('.selector').MonthPicker({ MaxMonth: 0 });
Get or set the option, after init.
//getter
var month = $('.selector').MonthPicker('option', 'MaxMonth');

// Set's the maximum selectable month to one year and three months
// from today.
$('.selector').MonthPicker('option', 'MaxMonth', '+1y +3m');