Is it possible to get the day of the week from the onSelect event of the datepicker.
I know I can get the day of the month, but I want the day of the week. Even jus
This should do the trick:
function(event, ui) {
var date = $(this).datepicker('getDate');
var dayOfWeek = date.getUTCDay();
};
This has the advantage of not needing to parse whatever arbitrary date format you've chosen for the Datepicker's text field - the getDate
method returns a native Javascript Date
object which you can then easily extract the date fields you need.