Find day of date using JQuery

jquery

Solution

You could use JavaScript's Date.getDay()

  $(document).ready(function() {

    var d = new Date();

    alert(d.getDay());
  } );

As stated you don't need jQuery to use this but I've wrapped it in jQuery for your pleasure. As stated by nc3b the result its 0 based where 0 is Sunday.

Problem

How can I get day of given date using jQuery? In c# I do it like this ``` if(MyDate.DayOfWeek == DayOfWeek.Sunday) ``` How can i do this in jQuery?

Original source