Changeset 3448

Show
Ignore:
Timestamp:
09/13/2008 11:36:20 AM (3 months ago)
Author:
Shadowhand
Message:

Fixing #764, thanks Delapouite.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/classes/calendar.php

    r3366 r3448  
    2828         * Returns an array of the names of the days, using the current locale. 
    2929         * 
    30          * @param   boolean  return short names 
     30         * @param   integer  left of day names 
    3131         * @return  array 
    3232         */ 
    33         public static function days($short = FALSE) 
     33        public static function days($length = TRUE) 
    3434        { 
    3535                // strftime day format 
    36                 $format = ($short == TRUE) ? '%a' : '%A'; 
     36                $format = ($length > 3) ? '%A' : '%a'; 
    3737 
    3838                // Days of the week 
     
    5454                        } 
    5555                } 
    56                 elseif ($short == TRUE) 
     56 
     57                if (is_int($length) OR ctype_digit($length)) 
    5758                { 
    5859                        foreach ($days as $i => $day) 
    5960                        { 
    60                                 // Shorten the day names to 3 letters 
    61                                 $days[$i] = substr($day, 0, 3); 
     61                                // Shorten the days to the expected length 
     62                                $days[$i] = utf8::substr($day, 0, $length); 
    6263                        } 
    6364                }