diff --git a/core/util.inc.php b/core/util.inc.php index 0dacde1d..163458fa 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -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));