Nodejs Utililty Methods Month Format

List of utility methods to do Month Format

Description

The list of methods to do Month Format are organized into topic(s).

Method

getFullMonth()
Date.prototype.getFullMonth = function() {
  const month = this.getMonth()+1
  return month < 10 ? '0'+month : month
getFullMonth()
Date.prototype.getFullMonth = function(){  
  if (this.getMonth() < 9) {
    return '0' + (1 + this.getMonth());
  return 1 + this.getMonth();
};
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];