List of utility methods to do Hour Get
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); }; |