Nodejs Utililty Methods Day Name

List of utility methods to do Day Name

Description

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

Method

getDayName()
Date.prototype.getDayName = function(){
  return {
      0: 'Sunday',
      1: 'Monday',
      2: 'Tuesday',
      3: 'Wednesday',
      4: 'Thursday',
      5: 'Friday',
      6: 'Saturday'
...
getDayName()
Date.prototype.getDayName = function() {
  var d = ['Sunday','Monday','Tuesday','Wednesday',
           'Thursday','Friday','Saturday'];
  return d[this.getDay()];
getDayName()
Date.prototype.getDayName = function () {
  var map = ['sun', 'mon', 'tue', 'wed', 'thr', 'fri', 'sat'];
  return map[this.getDay()];
};
getDayName()
Date.prototype.getDayName = function()
    "use strict";
    var dayName = ["SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"];
    return dayName[this.getDay()];
};
getDayName()
Date.prototype.getDayName = function(){
  var d = new Date(+this);
  var dayName = d.getDay();
  switch(dayName) {
    case 0:
      return "Sunday";
      break;
    case 1:
      return "Monday";
...
getDayName()
Date.prototype.getDayName = function() {
  switch(this.getDay()) {
    case 1:
      return 'Monday';
    case 2:
      return 'Tuesday';
    case 3:
      return 'Wednesday';
    case 4:
...
getDayName(shortName)
Date.prototype.getDayName = function(shortName) {
   var Days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
   if (shortName) {
      return Days[this.getDay()].substr(0,3);
   } else {
      return Days[this.getDay()];
};