本文整理匯總了PHP中JEVHelper::getDayName方法的典型用法代碼示例。如果您正苦於以下問題:PHP JEVHelper::getDayName方法的具體用法?PHP JEVHelper::getDayName怎麽用?PHP JEVHelper::getDayName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JEVHelper
的用法示例。
在下文中一共展示了JEVHelper::getDayName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: jev_strftime
/**
* 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);
}
}
示例2: getDayName
/**
* 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;
}