Nodejs Minute Calculate olderThan(minutes)

Here you can find the source of olderThan(minutes)

Method Source Code

Date.prototype.olderThan = function(minutes) {
  var now = new Date();
  return now.getTime() - this.getTime() > minutes*60*1000
};

Related

  1. getMinute()
    Date.prototype.getMinute = function () {
        return (this.getMinutes() < 10 ? '0' : '') + this.getMinutes();
    };
    
  2. getMinutesFormatted(number)
    Date.prototype.getMinutesFormatted = function(number) {
        var minutes = this.getMinutes();
        return minutes < 10 ? '0' + minutes : minutes;
    };
    
  3. getMinutesTwoDigits()
    Date.prototype.getMinutesTwoDigits = function()
        var retval = this.getMinutes();
        if (retval < 10)
            return ("0" + retval.toString());
        else
            return retval.toString();
    };
    
  4. getSimpleMinutesgetSimpleMinutes()
    Date.prototype.getSimpleMinutes = function getSimpleMinutes() {
      var ss_ofs = this.getDaySimpleSeconds();
      var sm_ofs = Math.floor(ss_ofs/100);
      var sh_ofs = Math.floor(sm_ofs/100);
      return sm_ofs-sh_ofs*100;
    
  5. isXMinutesBeforeNow(minutes)
    Date.prototype.isXMinutesBeforeNow = function(minutes)
      minutes = parseInt(minutes);
      if (minutes !== minutes){
        console.warn('Date.isXMinutesBeforeNow: @param: minutes is NaN');
        return true;
      var d = Date.now();
      return (d - this) > (parseInt(minutes) * 60 *1000);
    ...
    
  6. removeMinutes(m)
    Date.prototype.removeMinutes = function (m) {
      this.setMinutes(this.getMinutes()-m);
      return this;
    };
    
  7. timeHourMinute()
    Date.prototype.timeHourMinute = function () {
        return ((this.getHours() < 10)?"0":"") + this.getHours() +":"+ ((this.getMinutes() < 10)?"0":"") + this.getMinutes();
    
  8. timeMinute()
    Date.prototype.timeMinute = function () {
         return ((this.getMinutes() < 10)?"0":"") + this.getMinutes();
    
  9. totalMinutes()
    Date.prototype.totalMinutes = function(){
      return this.getHours()*60+this.getMinutes()