Try to limit the date selection between today and 31st Dec of next year.
$(function() {
$('.public-holiday-date-pick').datepicker({
minDate: '0',
yearRange: '-0:+1',
maxDate: ???
hideIfNoPrevNext: true
});
});
How should I define maxDate ? tried few things like '31 12 +1', or just 'last day of next year', did not work.
1) First get today's using
2) Similarly set the
lastDate
as belowThe value in
lastDate
will be likeFinally set the
lastDate
asmaxDate
JSFiddle