Nodejs Month Name Get getMonthName()

Here you can find the source of getMonthName()

Method Source Code

Date.prototype.getMonthName = function () {
  var months = ["jan", "feb", "mar", "apr", "may", "june", "july", "aug", "sept", "oct", "nov", "dec"];
  return months[this.getMonth()];
};

Related

  1. getMonthName()
    Date.prototype.getMonthName = function() {
      var m = ['January','February','March','April','May','June','July',
               'August','September','October','November','December'];
      return m[this.getMonth()];
    
  2. getMonthName()
    Date.prototype.monthNames = [
        "January", "February", "March",
        "April", "May", "June",
        "July", "August", "September",
        "October", "November", "December"
    ];
    Date.prototype.getMonthName = function() {
        return this.monthNames[this.getMonth()];
    };
    ...
    
  3. getMonthName()
    Date.prototype.getMonthName = function() {
       return ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][this.getMonth()];
    };
    
  4. getMonthName()
    Date.prototype.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
    Date.prototype.getMonthName = function() {
        return this.monthNames[this.getMonth()];
    };
    Date.prototype.getShortMonthName = function () {
        return this.getMonthName().substr(0, 3);
    };