本文整理汇总了PHP中CCalendar::DFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP CCalendar::DFormat方法的具体用法?PHP CCalendar::DFormat怎么用?PHP CCalendar::DFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCalendar
的用法示例。
在下文中一共展示了CCalendar::DFormat方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetFromToHtml
public static function GetFromToHtml($fromTs = false, $toTs = false, $skipTime = false, $dtLength = 0)
{
$deltaTimezone = date("Z", $fromTs) - date("Z", $toTs);
if ($deltaTimezone !== 0) {
$toTs += $deltaTimezone;
}
// Formats
$formatShort = CCalendar::DFormat(false);
$formatFull = CCalendar::DFormat(true);
$formatTime = str_replace($formatShort, '', $formatFull);
if ($formatTime == $formatFull) {
$formatTime = "H:i";
} else {
$formatTime = str_replace(':s', '', $formatTime);
}
if ($skipTime) {
if ($dtLength == self::DAY_LENGTH) {
$html = FormatDate(array("tommorow" => "tommorow", "today" => "today", "yesterday" => "yesterday", "-" => $formatShort, "" => $formatShort), $fromTs);
$html .= ', ' . GetMessage('EC_VIEW_FULL_DAY');
} else {
$from = FormatDate(array("tommorow" => "tommorow", "today" => "today", "yesterday" => "yesterday", "-" => $formatShort, "" => $formatShort), $fromTs);
$to = FormatDate(array("tommorow" => "tommorow", "today" => "today", "yesterday" => "yesterday", "-" => $formatShort, "" => $formatShort), $toTs - self::DAY_LENGTH);
$html = GetMessage('EC_VIEW_DATE_FROM_TO', array('#DATE_FROM#' => $from, '#DATE_TO#' => $to));
}
} else {
// Event during one day
if (date('dmY', $fromTs) == date('dmY', $toTs)) {
$html = FormatDate(array("tommorow" => "tommorow", "today" => "today", "yesterday" => "yesterday", "-" => $formatShort, "" => $formatShort), $fromTs);
$html .= ', ' . GetMessage('EC_VIEW_TIME_FROM_TO_TIME', array('#TIME_FROM#' => FormatDate($formatTime, $fromTs), '#TIME_TO#' => FormatDate($formatTime, $toTs)));
} else {
$html = GetMessage('EC_VIEW_DATE_FROM_TO', array('#DATE_FROM#' => FormatDate($formatFull, $fromTs), '#DATE_TO#' => FormatDate($formatFull, $toTs)));
}
}
return $html;
}
示例2: UpdateModificationLabel
public static function UpdateModificationLabel($arId = array())
{
global $DB;
if (!is_array($arId) && $arId) {
$arId = array($arId);
}
$arId = array_unique($arId);
$strIds = array();
foreach ($arId as $id) {
if (intVal($id) > 0) {
$strIds[] = intVal($id);
}
}
$strIds = implode(',', $strIds);
if ($strIds) {
$strSql = "UPDATE b_calendar_section SET " . $DB->PrepareUpdate("b_calendar_section", array('TIMESTAMP_X' => FormatDate(CCalendar::DFormat(true), mktime()))) . " WHERE ID in (" . $strIds . ")";
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
}
}
示例3: DialogViewEvent
//.........这里部分代码省略.........
if ($event['RRULE']['INTERVAL'] == 1) {
$repeatHTML = GetMessage('EC_RRULE_EVERY_DAY');
} else {
$repeatHTML = GetMessage('EC_RRULE_EVERY_DAY_1', array('#DAY#' => $event['RRULE']['INTERVAL']));
}
break;
case 'WEEKLY':
$daysList = array();
foreach ($event['RRULE']['BYDAY'] as $day) {
$daysList[] = GetMessage('EC_' . $day);
}
$daysList = implode(', ', $daysList);
if ($event['RRULE']['INTERVAL'] == 1) {
$repeatHTML = GetMessage('EC_RRULE_EVERY_WEEK', array('#DAYS_LIST#' => $daysList));
} else {
$repeatHTML = GetMessage('EC_RRULE_EVERY_WEEK_1', array('#WEEK#' => $event['RRULE']['INTERVAL'], '#DAYS_LIST#' => $daysList));
}
break;
case 'MONTHLY':
if ($event['RRULE']['INTERVAL'] == 1) {
$repeatHTML = GetMessage('EC_RRULE_EVERY_MONTH');
} else {
$repeatHTML = GetMessage('EC_RRULE_EVERY_MONTH_1', array('#MONTH#' => $event['RRULE']['INTERVAL']));
}
break;
case 'YEARLY':
if ($event['RRULE']['INTERVAL'] == 1) {
$repeatHTML = GetMessage('EC_RRULE_EVERY_YEAR', array('#DAY#' => $event['FROM_MONTH_DAY'], '#MONTH#' => $event['FROM_MONTH']));
} else {
$repeatHTML = GetMessage('EC_RRULE_EVERY_YEAR_1', array('#YEAR#' => $event['RRULE']['INTERVAL'], '#DAY#' => $event['FROM_MONTH_DAY'], '#MONTH#' => $event['FROM_MONTH']));
}
break;
}
$repeatHTML .= '<br>' . GetMessage('EC_RRULE_FROM', array('#FROM_DATE#' => FormatDate(CCalendar::DFormat(false), $event['~DT_FROM_TS'])));
if (date('dmY', $event['RRULE']['UNTIL']) != '01012038') {
$repeatHTML .= ' ' . GetMessage('EC_RRULE_UNTIL', array('#UNTIL_DATE#' => FormatDate(CCalendar::DFormat(false), $event['RRULE']['UNTIL'])));
}
?>
<tr>
<td class="bx-cal-view-text-cell-l"><?php
echo GetMessage('EC_T_REPEAT');
?>
:</td>
<td class="bx-cal-view-text-cell-r"><?php
echo $repeatHTML;
?>
</td>
</tr>
<?php
}
?>
<?php
if (!empty($event['LOCATION'])) {
?>
<tr>
<td class="bx-cal-view-text-cell-l"><?php
echo GetMessage('EC_LOCATION');
?>
:</td>
<td class="bx-cal-view-text-cell-r"><span class="bx-cal-location"><?php
echo htmlspecialcharsEx(CCalendar::GetTextLocation($event['LOCATION']));
?>
</span></td>
</tr>
<?php
}
示例4: GetMessage
if ($RRULE['INTERVAL'] == 1) {
$repeatHTML = GetMessage('EC_RRULE_EVERY_MONTH');
} else {
$repeatHTML = GetMessage('EC_RRULE_EVERY_MONTH_1', array('#MONTH#' => $RRULE['INTERVAL']));
}
break;
case 'YEARLY':
if ($RRULE['INTERVAL'] == 1) {
$repeatHTML = GetMessage('EC_RRULE_EVERY_YEAR', array('#DAY#' => 0, '#MONTH#' => 0));
} else {
$repeatHTML = GetMessage('EC_RRULE_EVERY_YEAR_1', array('#YEAR#' => $RRULE['INTERVAL'], '#DAY#' => 0, '#MONTH#' => 0));
}
break;
}
if ($RRULE['UNTIL'] != '' && date('dmY', $RRULE['UNTIL']) != '01012038') {
$repeatHTML .= '<br>' . GetMessage('EC_RRULE_UNTIL', array('#UNTIL_DATE#' => FormatDate(CCalendar::DFormat(false), $RRULE['UNTIL'])));
}
?>
<tr>
<td class="feed-calendar-view-text-cell-l"><?php
echo GetMessage('EC_T_REPEAT');
?>
:</td>
<td class="feed-calendar-view-text-cell-r"><?php
echo $repeatHTML;
?>
</td>
</tr>
<?php
}
/*if ($arResult['EVENT']['RRULE'] !== '')*/
示例5: GetFromToHtml
public static function GetFromToHtml($fromTs = false, $toTs = false, $skipTime = false, $dtLength = 0)
{
// Formats
$formatShort = CCalendar::DFormat(false);
$formatFull = CCalendar::DFormat(true);
$formatTime = str_replace($formatShort, '', $formatFull);
if ($formatTime == $formatFull)
$formatTime = "H:i";
else
$formatTime = str_replace(':s', '', $formatTime);
if ($skipTime)
{
if ($dtLength == 86400) // One full day event
{
$html = FormatDate(array(
"tommorow" => "tommorow",
"-" => $formatShort,
"today" => "today",
"yesterday" => "yesterday",
"" => $formatShort,
), $fromTs);
$html .= ', '.GetMessage('EC_VIEW_FULL_DAY');
}
else // Event for several days
{
$from = FormatDate(array(
"tommorow" => "tommorow",
"-" => $formatShort,
"today" => "today",
"yesterday" => "yesterday",
"" => $formatShort,
), $fromTs);
$to = FormatDate(array(
"tommorow" => "tommorow",
"-" => $formatShort,
"today" => "today",
"yesterday" => "yesterday",
"" => $formatShort,
), $toTs);
$html = GetMessage('EC_VIEW_DATE_FROM_TO', array('#DATE_FROM#' => $from, '#DATE_TO#' => $to));
}
}
else
{
// Event during one day
if(date('dmY', $fromTs) == date('dmY', $toTs))
{
$html = FormatDate(array(
"tommorow" => "tommorow",
"-" => $formatShort,
"today" => "today",
"yesterday" => "yesterday",
"" => $formatShort,
), $fromTs);
$html .= ', '.GetMessage('EC_VIEW_TIME_FROM_TO_TIME', array('#TIME_FROM#' => FormatDate($formatTime, $fromTs), '#TIME_TO#' => FormatDate($formatTime, $toTs)));
}
else
{
$html = GetMessage('EC_VIEW_DATE_FROM_TO', array('#DATE_FROM#' => FormatDate($formatFull, $fromTs), '#DATE_TO#' => FormatDate($formatFull, $toTs)));
}
}
return $html;
}