Exemple #1
0
 /**
  * Returns an array of 7 week day names (first index = 0)
  * @param string (optional) format of returned days (one,two,short or long)
  * @return array
  * @access public
  * @static
  */
 function weekdayNames($format = 'long')
 {
     $formats = array('one' => 'D', 'two' => 'D', 'short' => 'D', 'long' => 'l');
     if (!array_key_exists($format, $formats)) {
         $format = 'long';
     }
     $days = array();
     for ($i = 0; $i <= 6; $i++) {
         $stamp = mktime(0, 0, 0, 11, $i + 2, 2003);
         $day = Calendar_Util_Textual::translatedName(date($formats[$format], $stamp));
         switch ($format) {
             case 'one':
                 $day = substr($day, 0, 1);
                 break;
             case 'two':
                 $day = substr($day, 0, 2);
                 break;
         }
         $days[$i] = $day;
     }
     return $days;
 }