I want to set default date and min date to my date picker using jquery.
This is my jquery code:
There have an ajax call before setting the date:
After that :
$('#'+categoryedit ).datepicker();
$('#'+categoryedit ).datepicker('setDate', valnew);
$( "#"+categoryedit ).datepicker( 'option', 'minDate', new Date(nextdate) );
Here valnew and nextdate have dates.The mindate worked ,but the default date not setting.
What is the problem in my code?
How can i solve it?
You can set it all when initializing the datepicker: