Nodejs Month Name Get monthNames[

Here you can find the source of monthNames[

Method Source Code

Date.prototype.monthNames = [
  "January",/*  w w  w  .j  ava2s  .c om*/
  "February",
  "March",
  "April",
  "May",
  "June",
  "July",
  "August",
  "September",
  "October",
  "November",
  "December"
];

// class methods

Date.getMonthName = function (month) {
  return Date.prototype.monthNames[month];
};

Date.getShortMonthName = function (month) {
  return Date.getMonthName(month).substr(0, 3);
};

// instance methods

Date.prototype.getMonthName = function() {
  return this.monthNames[this.getMonth()];
};

Date.prototype.getShortMonthName = function () {
  return this.getMonthName().substr(0, 3);
};

Related

  1. getMonthNameShort(lang)
    Date.prototype.getMonthNameShort = function (lang) {
      lang = lang && (lang in Date.locale) ? lang : 'en';
      return Date.locale[lang].monthNamesShort[this.getMonth()];
    };
    
  2. getMonthFormatted()
    Date.prototype.getMonthFormatted = function() {
        var month = this.getMonth()+1;
        return month < 10 ? '0' + month : month; 
    
  3. getMonthInWords()
    Date.prototype.getMonthInWords = function() {
        return ["Jan",
                "Feb",
                "Mar",
                "Apr",
                "May",
                "Jun",
                "Jul",
                "Aug",
    ...
    
  4. getMonthOfYear()
    var monthsInYear = ["January ", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
    Date.prototype.getMonthOfYear = function() {
      return monthsInYear[this.getMonth()];
    
  5. monthNames[
    Date.prototype.monthNames = [
      "January", "February", "March",
      "April", "May", "June",
      "July", "August", "September",
      "October", "November", "December"
    ];
    Date.prototype.getMonthName = function() {
      return this.monthNames[this.getMonth()];
    };
    ...
    
  6. monthNames[
    Date.prototype.monthNames = [
      "January", "February", "March",
      "April", "May", "June",
      "July", "August", "September",
      "October", "November", "December"
    ];
    Date.prototype.getMonthName = function() {
      return this.monthNames[this.getMonth()];
    };
    ...