diff options
author | Dries <dries@buytaert.net> | 2012-01-25 08:19:45 -0500 |
---|---|---|
committer | Dries <dries@buytaert.net> | 2012-01-25 08:19:45 -0500 |
commit | 85a23905e331fa343f84c2713f11b9cb4dfe49e8 (patch) | |
tree | 70810e4f212ae7f368e60621ba2d5f34062526ac | |
parent | 7361ef66a57a84346a2906a0d8250177e953e915 (diff) | |
download | brdo-85a23905e331fa343f84c2713f11b9cb4dfe49e8.tar.gz brdo-85a23905e331fa343f84c2713f11b9cb4dfe49e8.tar.bz2 |
- Patch #1416218 by scorchio: Improve variable naming in format_interval().
-rw-r--r-- | includes/common.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/common.inc b/includes/common.inc index 3e79239f5..b07bf9669 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1817,7 +1817,7 @@ function format_size($size, $langcode = NULL) { /** * Formats a time interval with the requested granularity. * - * @param $timestamp + * @param $interval * The length of the interval in seconds. * @param $granularity * How many different units to display in the string. @@ -1828,7 +1828,7 @@ function format_size($size, $langcode = NULL) { * @return * A translated string representation of the interval. */ -function format_interval($timestamp, $granularity = 2, $langcode = NULL) { +function format_interval($interval, $granularity = 2, $langcode = NULL) { $units = array( '1 year|@count years' => 31536000, '1 month|@count months' => 2592000, @@ -1841,9 +1841,9 @@ function format_interval($timestamp, $granularity = 2, $langcode = NULL) { $output = ''; foreach ($units as $key => $value) { $key = explode('|', $key); - if ($timestamp >= $value) { - $output .= ($output ? ' ' : '') . format_plural(floor($timestamp / $value), $key[0], $key[1], array(), array('langcode' => $langcode)); - $timestamp %= $value; + if ($interval >= $value) { + $output .= ($output ? ' ' : '') . format_plural(floor($interval / $value), $key[0], $key[1], array(), array('langcode' => $langcode)); + $interval %= $value; $granularity--; } |