Can we add extra functionality to the function display_date ?
Which displays the time ago, while currently we have basic function like Today and Yesterday only.
It will be more better if we can add time ago --> (s) ago
Second
Minutes
Hour
Day
Month
public static function display_date($var)
{
$shift = (self::$system_set['timeshift'] + self::$user_set['timeshift']) * 3600;
if (date('Y', $var) == date('Y', time())) {
if (date('z', $var + $shift) == date('z', time() + $shift)) {
return self::$lng['today'] . ', ' . date("H:i", $var + $shift);
}
if (date('z', $var + $shift) == date('z', time() + $shift) - 1) {
return self::$lng['yesterday'] . ', ' . date("H:i", $var + $shift);
}
}
return date("d.m.Y / H:i", $var + $shift);
}