If you are using the jquery datepicker and have been displaying the date in the usual mysql date format, you probably will find it annoying that the date picker gives you the slash date format back. Here is how to keep the mysql date dash format all throughout.
var queryDate = '2012-01-10', dateParts = queryDate.match(/(d+)/g) realDate = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]); // months are 0-based! $('#datePicker').datepicker({ dateFormat: 'yy-mm-dd' }); // format to show $('#datePicker').datepicker('setDate', realDate);
The code above will translate the mysql date to do the initial setup, then use the dash format for the text field.
Ref: http://stackoverflow.com/questions/1953840/datepickersetdate-issues-in-jquery
thanks alot uve helped me
LikeLike