Nodejs Month Name Get getMonthInWords()

Here you can find the source of getMonthInWords()

Method Source Code

Date.prototype.getMonthInWords = function() {
    return ["Jan",
            "Feb",
            "Mar",
            "Apr",
            "May",
            "Jun",
            "Jul",
            "Aug",
            "Sep",
            "Oct",
            "Nov",
            "Dec"]
            [this.getMonth()];//w w w  . j av  a 2  s .  c om
};

Related

  1. getMonthName(lang)
    Date.prototype.getMonthName = function(lang) {
        lang = lang && (lang in Date.locale) ? lang : 'de';
        return Date.locale[lang].month_names[this.getMonth()];
    };
    Date.locale = {
        de: {
            month_names: ['Januar', 'Februar', 'M?', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
            month_names_short: ['Jan', 'Feb', 'M?, 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
            day_names: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
    ...
    
  2. getMonthName(lang)
    Date.prototype.getMonthName = function (lang) {
      lang = lang && (lang in Date.locale) ? lang : 'en';
      return Date.locale[lang].monthNames[this.getMonth()];
    };
    Date.locale = {
      en: {
        monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
        monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    };
    
  3. getMonthNameShort(lang)
    Date.prototype.getMonthNameShort = function(lang) {
        lang = lang && (lang in Date.locale) ? lang : 'de';
        return Date.locale[lang].month_names_short[this.getMonth()];
    };
    Date.locale = {
        de: {
            month_names: ['Januar', 'Februar', 'M?', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
            month_names_short: ['Jan', 'Feb', 'M?, 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
            day_names: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
    ...
    
  4. getMonthNameShort(lang)
    Date.prototype.getMonthNameShort = function (lang) {
      lang = lang && (lang in Date.locale) ? lang : 'en';
      return Date.locale[lang].monthNamesShort[this.getMonth()];
    };
    
  5. getMonthFormatted()
    Date.prototype.getMonthFormatted = function() {
        var month = this.getMonth()+1;
        return month < 10 ? '0' + month : month; 
    
  6. getMonthOfYear()
    var monthsInYear = ["January ", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
    Date.prototype.getMonthOfYear = function() {
      return monthsInYear[this.getMonth()];
    
  7. 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()];
    };
    ...
    
  8. monthNames[
    Date.prototype.monthNames = [
      "January",
      "February",
      "March",
      "April",
      "May",
      "June",
      "July",
      "August",
    ...
    
  9. 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()];
    };
    ...