Nodejs Day Name getDayName(shortName)

Here you can find the source of getDayName(shortName)

Method Source Code

Date.prototype.getDayName = function(shortName) {
   var Days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
   if (shortName) {
      return Days[this.getDay()].substr(0,3);
   } else {/*from   w  w w . ja  va  2 s. c  o m*/
      return Days[this.getDay()];
   }
};

Related

  1. getDayName()
    Date.prototype.getDayName = function() {
      var d = ['Sunday','Monday','Tuesday','Wednesday',
               'Thursday','Friday','Saturday'];
      return d[this.getDay()];
    
  2. getDayName()
    Date.prototype.getDayName = function () {
      var map = ['sun', 'mon', 'tue', 'wed', 'thr', 'fri', 'sat'];
      return map[this.getDay()];
    };
    
  3. getDayName()
    Date.prototype.getDayName = function()
        "use strict";
        var dayName = ["SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"];
        return dayName[this.getDay()];
    };
    
  4. 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";
    ...
    
  5. getDayName()
    Date.prototype.getDayName = function() {
      switch(this.getDay()) {
        case 1:
          return 'Monday';
        case 2:
          return 'Tuesday';
        case 3:
          return 'Wednesday';
        case 4:
    ...