Javascript Date isLastDayOfMonth()

Description

Javascript Date isLastDayOfMonth()


Date.prototype.isLastDayOfMonth = function(){
  var today = new Date();
    var month = today.getMonth();

    today.setDate(today.getDate() + 1);/* w ww .  j av a2  s .  c  o  m*/
    return today.getMonth() !== month;
 
}

Date.prototype.getLogDate = function (){
 return this.getDate()+ '/' + (this.getMonth()+1)+ '/' + this.getFullYear() +' ' +this.getHours()+':'+ (this.getMinutes()<10 ? '0'+this.getMinutes():this.getMinutes()) +':'+(this.getSeconds()<10 ? '0'+this.getSeconds():this.getSeconds());
}

Date.prototype.getMonthString = function(){
 var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
 return months[this.getMonth()]; 
}
module.exports = Date;



PreviousNext

Related