fix rules that rely on proper sorting of repeaters from widest to smallest
authorChuck Hagenbuch <chuck@horde.org>
Mon, 4 May 2009 03:07:56 +0000 (23:07 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Mon, 4 May 2009 03:07:56 +0000 (23:07 -0400)
framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base.php

index ee7aa49..a9029b8 100644 (file)
@@ -551,7 +551,8 @@ class Horde_Date_Parser_Locale_Base
             }
         }
 
-        rsort($repeaters);
+        // Return repeaters in order from widest (years) to smallest (seconds)
+        usort($repeaters, create_function('$a, $b', 'return $b->width() > $a->width();'));
         return $repeaters;
     }