Show
Ignore:
Timestamp:
05/07/2008 11:08:35 AM (7 months ago)
Author:
Shadowhand
Message:

Follow up to r2655, it's a good thing to have working methods.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/helpers/date.php

    r2656 r2657  
    380380                                        continue; 
    381381                                } 
    382                                 elseif ($amount === 1) 
    383                                 { 
    384                                         // Make the name singualr 
    385                                         $name = inflector::singular($name); 
    386                                 } 
    387  
    388                                 if ($name === $last) 
    389                                 { 
    390                                         // Add "and" 
    391                                         $amount = 'and '.$amount; 
    392                                 } 
    393382 
    394383                                // Add the amount to the span 
    395                                 $span[] = $amount.' '.$name; 
     384                                $span[] = ($name === $last ? ' and ' : ', ').$amount.' '.($amount === 1 ? inflector::singular($name) : $name); 
    396385                        } 
    397386 
    398                         $difference = implode(', ', $span).' ago'; 
     387                        // Replace difference by making the span into a string 
     388                        $difference = trim(implode('', $span), ',').' ago'; 
    399389                } 
    400390