javascript - How to disable future month and year in monthpicker -
I am using the month picker, I want to prevent users from choosing future months and years. How can I achieve that ? I tried
$ ("# month"). Monthpicker ({dateFormat: 'M-yy', autoSize: true, changeYear: true, changeMonth: true, showButtonPanel: true, maxDate: new date (.) GetMonth ()});
But with this I can only restrict the future year, I can still choose the future month. Any help would be appreciated.
By default, the year limit starts 10 years ago and ends in 10 years }; You can try this it is working for me. from context:
$ ('#custom_widget') monthpicker (option).
$ ('# my_widget'). Monthpicker ('disable', [1, 2, 11, 12]); $ ('# My_widget') Month picture ('disabled demand', []); // re-enables all months
Comments
Post a Comment