Nitesh kumar singh Posted December 5, 2020 Share Posted December 5, 2020 <input type="date" id="datepicker"> <script> let DateToday=new Date(); let month=DateToday.getMonth()+1; let day=DateToday.getDate(); let year=DateToday.getFullYear(); if(month<10) month='0'+month.toString(); if(day<10) day='0'+day.toString(); let Today=year+'-'+month+'-'+day; let maxdate=year+1+'-'+month+'-'+day; document.getElementById('datepicker').setAttribute("min",Today); </script> Link to comment Share on other sites More sharing options...
JMRKER Posted December 11, 2020 Share Posted December 11, 2020 What is the question? What do you want it to do? What is the "previous date" referring to in the title of your question? What browser are you using? Link to comment Share on other sites More sharing options...
ishan_shah Posted December 21, 2020 Share Posted December 21, 2020 try this: $( "#datepicker" ).datepicker({ minDate: Today}); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now