Changeset 8763
- Timestamp:
- 05/04/08 09:24:40 (5 months ago)
- Files:
-
- branches/1.0/lib/helper/DateHelper.php (modified) (1 diff)
- branches/1.0/test/unit/helper/DateHelperTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/lib/helper/DateHelper.php
r3815 r8763 149 149 { 150 150 $string = 'over %years% years'; 151 $parameters['%years%'] = round($distance_in_minutes / 525960);151 $parameters['%years%'] = floor($distance_in_minutes / 525960); 152 152 } 153 153 branches/1.0/test/unit/helper/DateHelperTest.php
r3167 r8763 13 13 sfLoader::loadHelpers(array('Helper', 'Asset', 'Url', 'Tag', 'Date')); 14 14 15 $t = new lime_test(49 3, new lime_output_color());15 $t = new lime_test(494, new lime_output_color()); 16 16 17 17 class sfContext … … 20 20 public static $instance = null; 21 21 22 public function getInstance()22 static public function getInstance() 23 23 { 24 24 if (!isset(self::$instance)) … … 81 81 82 82 $t->is(distance_of_time_in_words($now - 370 * 86400, $now), 'about 1 year', $msg); 83 $t->is(distance_of_time_in_words($now - 4 * 365 * 86400, $now), 'over 4 years', $msg); 83 $t->is(distance_of_time_in_words($now - 4 * 370 * 86400, $now), 'over 4 years', $msg); 84 $t->is(distance_of_time_in_words($now - 1000 * 86400, $now), 'over 2 years', $msg); 84 85 85 86 // format_date()