Get calendar day in English : Date Extension « Date Time « JavaScript DHTML






Get calendar day in English

  



<html>
<head>
  
  <script type="text/javascript">
    Date.prototype.getCalendarDay = getCalendarDay;
    function getCalendarDay() {
      var n = this.getDay();
      var dow = new Array(7);
      dow[0] = "Sunday";
      dow[1] = "Monday";
      dow[2] = "Tuesday";
      dow[3] = "Wednesday";
      dow[4] = "Thursday";
      dow[5] = "Friday";
      dow[6] = "Saturday";
      return dow[n];
    }
  </script>
</head>
<body>
<script type="text/javascript">
  var today = new Date();
  alert(today.getCalendarDay());
</script>

</body>
</html>

   
    
  








Related examples in the same category

1.Add user defined function method to Date object
2.Return actual month number
3.Return the actual day number from a date
4.Return English name from date object