We can get day of the week ( Sunday, Monday etc ) from the entered date by using getDay function. So by entering any date in mm/dd/yy format we can get the week day of it.
First we will read the entered date and then by using split command we will collect the date, month and year from it. Then by using them we will create a date object. This date object then we will use to get the week days by using getDay function. The output of getDay will be in the form of number starting from 0 and ending with 6 based on the week day. To display the full day we will use one array and display the week days accordingly.
<title>demo of getting day of the week from eneterd date</title>
var dt= new Date();
dt.setMonth(a1-1);// Month part
dt.setDate(a1); // Date part
dt.setFullYear(a1); // Year part
//display the full date //
var disp =dt.getDay(); // get the day of the week 0 to 6
var day_name=new Array(7);