$start = min($tagArgs[0], $tagArgs[1]);
$end = max($tagArgs[0], $tagArgs[1]);
- // TODO: method doesn't exists anymore
- // return DateUtil::diff($start, $end, 'string');
- return '';
+ return DateUtil::diff(DateUtil::getDateTimeByTimestamp($start), DateUtil::getDateTimeByTimestamp($end));
}
}
}
}
+ public static function diff(\DateTime $from, \DateTime $to) {
+ $interval = $from->diff($to);
+
+ // TODO: Use language items
+ return $interval->format('%Y years %M months %D days %H hours %I minutes %S seconds');
+ }
+
private function __construct() { }
}