javascript - How to disable future month and year in monthpicker -



javascript - How to disable future month and year in monthpicker -

i using month picker, want restrict users selecting future month , year. how can accomplish ? tried using

$("#month").monthpicker({ dateformat: 'm-yy', autosize: true, changeyear: true, changemonth: true, showbuttonpanel: true, maxdate: new date().getmonth() });

but restrict future year, can still select future month. help appreciated.

by default, year range starts 10 years ago , ends on 10 years now, having current year selected.

this , other settings can overwritten on widget initialization:

options = { pattern: 'yyyy-mm', // default 'mm/yyyy' , separator char not mandatory selectedyear: 2010, startyear: 2008, finalyear: 2012, monthnames: ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez']

};

$('#custom_widget').monthpicker(options);

you can seek this. working me.

$('#my_widget').monthpicker('disablemonths', [1, 2, 11, 12]); $('#my_widget').monthpicker('disablemonths', []); // re-enables months

reference : month picker jquery

javascript jquery-ui datepicker

Comments

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -