Nodejs Utililty Methods Hour Get

List of utility methods to do Hour Get

Description

The list of methods to do Hour Get are organized into topic(s).

Method

minusHours(hrs)
Date.prototype.minusHours = function(hrs) {
    this.setHours(this.getHours() - hrs);
    return this;
};
removeHours(h)
Date.prototype.removeHours = function (h) {
  this.setHours(this.getHours()-h);
  return this;
};
roundToHour()
Date.prototype.roundToHour = function() {
    if (this.getMinutes() == 0)
        return; 
    if (this.getHours() < 23)
        this.setHours(this.getHours() + 1);
    this.setMinutes(0);
};