當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CCalendar::DFormat方法代碼示例

本文整理匯總了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;
 }
開發者ID:andy-profi,項目名稱:bxApiDocs,代碼行數:35,代碼來源:calendar.php

示例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__);
     }
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:19,代碼來源:calendar_sect.php

示例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 
        }
開發者ID:Satariall,項目名稱:izurit,代碼行數:67,代碼來源:calendar_sceleton.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'] !== '')*/
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:template.php

示例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;
	}
開發者ID:ASDAFF,項目名稱:bxApiDocs,代碼行數:68,代碼來源:calendar.php


注:本文中的CCalendar::DFormat方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。