Exemplo n.º 1
0
 public static function setTimeLocales()
 {
     global $cfg;
     date_default_timezone_set(self::$timeZones[!empty(User::$timeZone) ? User::$timeZone : Kio::getConfig('time_zone')]);
     // Translate days and months in date()
     if (TRANSLATE_DATE && preg_match('#F|M|l|d#', self::getConfig('date_format') . self::getConfig('short_date_format'))) {
         self::$months = self::$monthsFormated = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', 13 => 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
         self::$days = self::$daysFormated = array(1 => 'Monday', 'Tu', 'We', 'Th', 'Fr', 'Saturday', 'Sunday', 8 => 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun');
         for ($i = 1; $i < 25; $i++) {
             self::$monthsFormated[$i] = strtr(addcslashes(t(self::$months[$i]), 'A..z'), array('l' => '&#108;', 'D' => '&#68;'));
         }
         for ($i = 1; $i < 15; $i++) {
             self::$daysFormated[$i] = strtr(addcslashes(t(self::$days[$i]), 'A..z'), array('l' => '&#108;', 'D' => '&#68;'));
         }
     }
     if (Kio::getConfig('time_relative')) {
         self::$today = strtr(addcslashes(t('Today'), 'A..z'), array('l' => '&#108;', 'D' => '&#68;'));
         self::$yesterday = strtr(addcslashes(t('Yesterday'), 'A..z'), array('l' => '&#108;', 'D' => '&#68;'));
         self::$tommorow = strtr(addcslashes(t('Tommorow'), 'A..z'), array('l' => '&#108;', 'D' => '&#68;'));
     }
 }