I have a simple datepicker text field:
<input type="text" name="book_on" id="book_on" value="<?php echo $today; ?>"
The jQuery is as follows:
$('#book_on').datepicker({
dateFormat: 'mm/dd/y'
});
This is all very straight-forward, but I also need to show the chosen date in a different format elsewhere on the page – specifically, when a date is chosen, I need to show which day of the week it is in a <span> on the page.
This would be dateFormat: 'D' but I can’t find a way to get the datepicker to return a second type of date format. I don’t need the whole code written, if you could just get the function above to alert the day of the week for the chosen date, that would be great.
Are you looking for something like this jsFiddle example?
jQuery: