Fix time intervals on report site not displaying correctly
Before this would display values such as "0 minute ago" and "1 minutes ago".
This commit is contained in:
parent
b808121d68
commit
e607960b6a
@ -319,22 +319,22 @@ function approximateHumanInterval($interval)
|
||||
{
|
||||
if ($interval->y > 0)
|
||||
{
|
||||
$humanString = $interval->y . ' year' . ($interval->y != 0 ? 's' : '');
|
||||
$humanString = $interval->y . ' year' . ($interval->y != 1 ? 's' : '');
|
||||
} else if ($interval->m > 0)
|
||||
{
|
||||
$humanString = $interval->m . ' month' . ($interval->m != 0 ? 's' : '');
|
||||
$humanString = $interval->m . ' month' . ($interval->m != 1 ? 's' : '');
|
||||
}
|
||||
else if ($interval->d > 0)
|
||||
{
|
||||
$humanString = $interval->d . ' day' . ($interval->d != 0 ? 's' : '');
|
||||
$humanString = $interval->d . ' day' . ($interval->d != 1 ? 's' : '');
|
||||
}
|
||||
else if ($interval->h > 0)
|
||||
{
|
||||
$humanString = $interval->h . ' hour' . ($interval->h != 0 ? 's' : '');
|
||||
$humanString = $interval->h . ' hour' . ($interval->h != 1 ? 's' : '');
|
||||
}
|
||||
else
|
||||
{
|
||||
$humanString = $interval->i . ' minute' . ($interval->i != 0 ? 's' : '');
|
||||
$humanString = $interval->i . ' minute' . ($interval->i != 1 ? 's' : '');
|
||||
}
|
||||
|
||||
return $humanString;
|
||||
|
Loading…
Reference in New Issue
Block a user