months and years for autodate
This commit is contained in:
parent
9a400645a2
commit
ab4f69eb88
1 changed files with 3 additions and 1 deletions
|
@ -103,7 +103,9 @@ function autodate($date) {
|
|||
if ($diff<60) return $diff . " minute" . plural($diff) . " ago"; $diff = round($diff/60);
|
||||
if ($diff<24) return $diff . " hour" . plural($diff) . " ago"; $diff = round($diff/24);
|
||||
if ($diff<7) return $diff . " day" . plural($diff) . " ago"; $diff = round($diff/7);
|
||||
if ($diff<4) return $diff . " week" . plural($diff) . " ago";
|
||||
if ($diff<4) return $diff . " week" . plural($diff) . " ago"; $diff = round($diff/4);
|
||||
if ($diff<12) return $diff . " month" . plural($diff) . " ago"; $diff = round($diff/12);
|
||||
if ($diff<99) return $diff . " year" . plural($diff) . " ago";
|
||||
}
|
||||
$format = $config->get_string('autodate_format', "F j, Y");
|
||||
return "on " . date($format, strtotime($date));
|
||||
|
|
Reference in a new issue