I have a requirement to disable future date, user should be able to choose only past and current date and vice versa
found below code in msdn forum and it working fine . But for the month which has 31 dates , its not working as expected.
eg.On31st the datepicker should be enabled until 31st oct but it enabled 1st Nov also . Please help me to fix this.
The issue occurs when i disable future date as well , here its enabled till 1st of Nov instead 31st oct.
Any body can help me on this
Thanks in advance
<scriptsrc="//code.jquery.com/jquery-3.2.1.min.js"type="text/javascript"></script>
<scripttype="text/javascript">var getSPDayDiff =function(date){returnMath.round(Math.abs((newDate(1601,0,1).getTime()- date.getTime())/(24*60*60*1000)));} $(function(){var currentDate =newDate(); currentDate.setMonth(currentDate.getMonth()+1);var minDay = getSPDayDiff(newDate());var maxDay = getSPDayDiff(currentDate);var datePicker=$("img[id^='DtStartDate']").parent();var onclickStr=datePicker.attr("onclick"); onclickStr=onclickStr.replace("minjday=109207","minjday="+minDay); onclickStr=onclickStr.replace("maxjday=2666269","maxjday="+maxDay); datePicker.attr("onclick",onclickStr);});</script>