Nodejs Month Format getFullMonth()

Here you can find the source of getFullMonth()

Method Source Code

Date.prototype.getFullMonth = function(){  // if month single diget add a 0
   if (this.getMonth() < 9) {
      return '0' + (1 + this.getMonth());
   }/*w  w  w . j  a v  a 2s  .  co  m*/
   return 1 + this.getMonth();
};

Related

  1. getFullMonth()
    Date.prototype.getFullMonth = function() {
      const month = this.getMonth()+1
      return month < 10 ? '0'+month : month
    
  2. getFullMonthText()
    Date.prototype.getFullMonthText = function() {
      var months = ["January", "February", "March", "April", "May", "June", "July", "August",
            "September", "October",  "November", "December"];
      var m = this.getMonth();
      return months[m];