Nodejs Utililty Methods Day of Week

List of utility methods to do Day of Week

Description

The list of methods to do Day of Week are organized into topic(s).

Method

dayOfWeek()
Date.prototype.dayOfWeek = function(){
  var days = ["Sunday", "Monday", "Tuesday", "Wednesday",
              "Thursday", "Friday", "Saturday"];
  return days[this.getDay()];
getDayOfWeek()
var weekday = new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
Date.prototype.getDayOfWeek = function() {
...
getDayOfWeek()
Date.prototype.getDayOfWeek = function(){   
    return ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][ this.getDay() ];
};
Date.prototype.getDayNum = function(){ 
    let day = this.getDay()
    if(day == 0) day = 7
    return day;
};
getDayOfWeek()
Date.prototype.getDayOfWeek = function() {
  var days = [
    "Sonntag",
    "Montag",
    "Dienstag",
    "Mittwoch",
    "Donnerstag",
    "Freitag",
    "Samstag"
...
getDayOfWeek(d)
Date.prototype.getDayOfWeek = function(d) {
  var days = ["Sun", "Mon", "Tue", "Wed", 
      "Thu", "Fri", "Sat"];
  return days[d];