How to get the day from a particular date using JavaScript -


I'm new to javascript. I need that t on a particular day (eg Sunday, Monday ...) When a date is selected, you want to pop up a message.

I tried the getday () function but it was not working please do it.

  var date = new date (); Var day = date.getDay ();  

day now holds the number from zero to six; Zero is Sunday, one is Monday, and so on.

Anything that remains, translate that number into the string for the name of the English name (or whatever other language):

  var name = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] [day];  

Comments