Exemplo n.º 1
0
 /**
  * Support all JevDate::strftime() parameter for Window systems
  *
  * @param string $format
  * @param int $timestamp
  * @return string formated string
  */
 function jev_strftime($format = '', $timestamp = null)
 {
     if (!$timestamp) {
         $timestamp = time();
     }
     // Replace names by own translation to get rid of improper os system library
     if (strpos($format, '%a') !== false) {
         $format = str_replace('%a', JEVHelper::getShortDayName(date('w', $timestamp)), $format);
     }
     if (strpos($format, '%A') !== false) {
         $format = str_replace('%A', JEVHelper::getDayName(date('w', $timestamp)), $format);
     }
     if (strpos($format, '%b') !== false) {
         $format = str_replace('%b', JEVHelper::getShortMonthName(date('n', $timestamp)), $format);
     }
     if (strpos($format, '%B') !== false) {
         $format = str_replace('%B', JEVHelper::getMonthName(date('n', $timestamp)), $format);
     }
     if (JUtility::isWinOS()) {
         if (!class_exists('JEV_CompatWin')) {
             require_once dirname(__FILE__) . '/compatwin.php';
         }
         return JEV_CompatWin::win_strftime($format, $timestamp);
     } else {
         return JevDate::strftime($format, $timestamp);
     }
 }
Exemplo n.º 2
0
 /**
  * returns name of the day longversion
  * @param	daynb		int		# of day
  * @param	colored		bool	color sunday	[ new mic, because inside tooltips a color forces an error! ]
  * */
 public static function getDayName($daynb, $colored = false)
 {
     $i = $daynb % 7;
     // modulo 7
     if ($i == '0' && $colored === true) {
         $dayname = '<span class="sunday">' . JEVHelper::getDayName($i) . '</span>';
     } else {
         if ($i == '6' && $colored === true) {
             $dayname = '<span class="saturday">' . JEVHelper::getDayName($i) . '</span>';
         } else {
             $dayname = JEVHelper::getDayName($i);
         }
     }
     return $dayname;
 }