Produces "days ago" if diff is between 24 and 7 days to the past

@return RuleInterface
191497
public static function daysAgo()
    {
        return self::getOrCreate('days-ago', function () {
            return RangeRule::createForNegativeValues(Unit::DAY, Unit::DAY * 7 - 1, [Results::class, 'calculateDaysAgo']);
        });
    }
924972
public function getIsExpired()
    {
        $createdAt = $this->getCreatedAt();
        if ($this->getExpiredAfter() === false || $createdAt === null) {
            return false;
        }
        if ($this->timeType == static::$timeTypeLocal) {
            return $this->getDatetimeOffset($this->offsetDatetime($this->currentDatetime(), -$this->getExpiredAfter()), $createdAt) > 0;
        } elseif ($this->timeType == static::$timeTypeUtc) {
            return $this->getDatetimeOffset($this->offsetDatetime($this->currentUtcDatetime(), -$this->getExpiredAfter()), $createdAt) > 0;
        }
        return false;
    }
1091817
public static function getLastRunTime()
    {
        $timestamp = Option::get(self::LAST_RUN_TIME_OPTION_NAME);
        return $timestamp === false ? false : Date::factory((int)$timestamp);
    }
424428
public function getDtEnd()
    {
        if (!$this->valid()) {
            return;
        }
        $end = clone $this->currentDate;

        return $end->modify('+'.$this->eventDuration.' seconds');
    }
1202336
function ruleBefore($date, $error_message = null) {
        if (!strtotime($date)) {
            throw new \Exception('Incorrect date');
        }

        return $this->_rule('before:' . $date, $error_message);
    }
979573
function getDateDiff (startDate, endDate, rules) {
  var startTime, endTime, item, diffTime, rule, len, index
  var result = { done: false, time: 0 }
  startDate = toStringDate(startDate)
  endDate = endDate ? toStringDate(endDate) : new Date()
  if (baseExports.isDate(startDate) && baseExports.isDate(endDate)) {
    startTime = getDateTime(startDate)
    endTime = getDateTime(endDate)
    if (startTime < endTime) {
      diffTime = result.time = endTime - startTime
      rule = rules && rules.length > 0 ? rules : setupDefaults.dateDiffRules
      result.done = true
      for (index = 0, len = rule.length; index < len; index++) {
        item = rule[index]
        if (diffTime >= item[1]) {
          if (index === len - 1) {
            result[item[0]] = diffTime || 0
          } else {
            result[item[0]] = Math.floor(diffTime / item[1])
            diffTime -= result[item[0]] * item[1]
          }
        } else {
          result[item[0]] = 0
        }
      }
    }
  }
  return result
}
1157575
def is_days_ago(adatetime, days):
    
    if days == 1:
        end_time = last_midnight()
        start_time = end_time - timedelta(days=1)
    else:
        start_time = last_midnight() - timedelta(days=days)
        end_time = start_time + timedelta(days=1)
    return start_time <= adatetime <= end_time
549575
public function deleteOutdated(): bool
    {
        $sql =  'DELETE FROM `' . $this->table . '`'
                . ' WHERE `' . $this->savetimeField . '`<'
                . '(' . time() . '-`' . $this->timestampField . '`)';
        return $this->db->query($sql);
    }
1294559
public function getLastUpdate()
    {
        $time = filemtime($this->parser->getFile());
        if ($time === false) {
            return new DataBackendException(
                "Could not read modification time from {$this->parser->getFile()}"
            );

        }
        return $time;
    }
739476
public function getRemainingSuspensionTime()
	{
		if(!$this->isSuspended())
			return 0;

		$lastAttempt = clone $this->last_attempt_at;

		$suspensionTime  = static::$suspensionTime;
		$clearAttemptsAt = $lastAttempt->modify("+{$suspensionTime} minutes");
		$now             = new Datetime;

		$timeLeft = $clearAttemptsAt->diff($now);

		$minutesLeft = ($timeLeft->s != 0 ?
						($timeLeft->days * 24 * 60) + ($timeLeft->h * 60) + ($timeLeft->i) + 1 :
						($timeLeft->days * 24 * 60) + ($timeLeft->h * 60) + ($timeLeft->i));

		return $minutesLeft;
	}
46285
public function recentlyCreated($nbDays = 7)
    {
        return $this->addUsingAlias(PersonFunctionTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
    }
757611
public function isOutdated()
    {
        if ($this->Fetched) {
            $fetched = new \DateTime($this->Fetched);
            $now = new \DateTime("now");
            $diff = $now->getTimestamp() - $fetched->getTimestamp();
            if ($diff > Client::getRefreshRate()) {
                return true;
            }
            return false;
        }

        return true;
    }
136341
public function lastEarnedDate() : \DateTime
    {
        return new \DateTime(
            $this->comparing() ?
            $this->group->comparedUser->lastUpdateDate :
            $this->group->fromUser->lastUpdateDate
        );
    }
953922
public function recentlyUpdated($nbDays = 7)
    {
        return $this->addUsingAlias(MediaTableMap::COL_UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
    }
109731
public function getTotalDays()
    {
        $start = new \DateTime($this->getFrom());
        $end = new \DateTime($this->getTo());
        $diff = $start->diff($end);
        return $diff->format('%a');
    }
821274
public static function upTo2Weeks()
    {
        return self::getOrCreate('up-to-2-weeks', function () {
            return new DateDiffCalculator([
                RangeRule::createForNegativeValues(2 * DateUnits::WEEK, INF, function (DateDiffRequest $request) {
                    return DateDiffResult::createFullDate($request);
                }),
                Rules::weeksAgo(),
                Rules::yesterday(),
                Rules::daysAgo(),
                Rules::hoursAgo(),
                Rules::minutesAgo(),
                Rules::secondsAgo()
            ]);
        });
    }
77332
public function getDateAdded() : ?DateTime
     {
        $rtn = $this->data['date_added'];

        if (!empty($rtn)) {
            $rtn = new DateTime($rtn);
        }

        return $rtn;
     }