Javascript Date isTodayAWeekend()

Description

Javascript Date isTodayAWeekend()


var Weekend = {};

Date.prototype.isTodayAWeekend = function(){
    return (this.getDay() > 0 && this.getDay() < 6) ? false : true;
};

result = new Date().isTodayAWeekend();
console.log(result);/*w  ww .  j  a  va2 s .  c om*/



PreviousNext

Related