diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-05-18 00:14:07 +0000 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-18 00:14:07 +0000 |
| commit | fd0c0a608a5de2b26c29d3c44a7929e5a3b2c042 (patch) | |
| tree | 387f2628cae3580b7f09682de6e908d002c5fbb0 /kohana/helpers/date.php | |
| parent | 5a6aef9c23930b1de609c9914297e0f97bc49a11 (diff) | |
Updated kohana and modules/unit_test to upstream r4356
Diffstat (limited to 'kohana/helpers/date.php')
| -rw-r--r-- | kohana/helpers/date.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kohana/helpers/date.php b/kohana/helpers/date.php index b926e626..1a5bbacb 100644 --- a/kohana/helpers/date.php +++ b/kohana/helpers/date.php @@ -374,7 +374,7 @@ class date_Core { $span = array(); foreach ($difference as $name => $amount) { - if ($name !== $last AND $amount === 0) + if ($amount === 0) { // Skip empty amounts continue; @@ -384,6 +384,12 @@ class date_Core { $span[] = ($name === $last ? ' and ' : ', ').$amount.' '.($amount === 1 ? inflector::singular($name) : $name); } + // If the difference is less than 60 seconds, remove the preceding and. + if (count($span) === 1) + { + $span[0] = ltrim($span[0], 'and '); + } + // Replace difference by making the span into a string $difference = trim(implode('', $span), ','); } |
