Determine if a date is a specific day

 

To determine  date of a specific day 

var myDate = new Date();



if(myDate.getDay() == 0) alert('Sunday');

if(myDate.getDay() == 1) alert('Monday');

if(myDate.getDay() == 2) alert('Tuesday');

if(myDate.getDay() == 3) alert('Wednesday');

if(myDate.getDay() == 4) alert('thursday');

if(myDate.getDay() == 5) alert('Friday');
if(myDate.getDay() == 6) alert('saturday');

Tags:

Share:

Related posts