Exemplo n.º 1
0
 /**
  * Returns "years ago" result with absolute diff in calendar years
  *
  * @param DateDiffRequest $request
  * @return DateDiffResult
  */
 public static function calculateYearsAgo(DateDiffRequest $request)
 {
     return new DateDiffResult($request, self::YEARS_AGO, $request->getInterval()->y);
 }
Exemplo n.º 2
0
 public function isApplicable(DateDiffRequest $diffRequest)
 {
     return !$diffRequest->getInterval()->invert && $diffRequest->getInterval()->y >= 1;
 }
Exemplo n.º 3
0
 public function isApplicable(DateDiffRequest $diffRequest)
 {
     $i = $diffRequest->getInterval();
     return !$i->invert && $i->d >= 7;
 }