I want to customize jquery ui date picker by setting server date as current date.
After refering a question
i wrote down
var queryDate = '2012-11-15',
dateParts = queryDate.match(/(\d+)/g)
realDate = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
// months are 0-based!
$('#datepicker').datepicker('setDate', realDate);
$('#datepicker').datepicker({ dateFormat: 'yy-mm-dd' });
it works, but when i change second step to
$('#datepicker').datepicker({ dateFormat: 'yy-mm-dd',minDate: 0,maxDate: '+6M' });
it shows dates according to the system date not the server date which i had assigned,
How to solve this??
You can just set the value of the input field to be a value from the server side:
In this case we are setting the date to 2012-02-25. In order for this to work you must set the format of the datepicker to be the same as the format that you’ve used for the value which is
'Y-m-d'