I am trying to get a Form to return the day of the week from the input of a Date Picker using the format dd/MM/yyyy
I found the following javascript in Answers:
$(document).ready(function () {
findDay();
function findDay() {
var d = new Date($('#Field20').val());
var weekday = new Array(7);
weekday[0]= "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
var n = weekday[d.getDay()];
$('.dayWeek select').val(n);
$('.dayWeek select').trigger('change');
}
$('.reportDate').on('change', 'input', findDay);
});
The problem is the above script only works if the Date Picker format is M/d/yyyy and the requirement is to have the format as dd/MM/yyyy
Just wondering what alterations are needed to the script to work with the dd/MM/yyyy format.