当前位置: 首页>>代码示例>>PHP>>正文


PHP CCalendar::GetMaxDate方法代码示例

本文整理汇总了PHP中CCalendar::GetMaxDate方法的典型用法代码示例。如果您正苦于以下问题:PHP CCalendar::GetMaxDate方法的具体用法?PHP CCalendar::GetMaxDate怎么用?PHP CCalendar::GetMaxDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCalendar的用法示例。


在下文中一共展示了CCalendar::GetMaxDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetMessage

            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#' => CCalendar::Date(CCalendar::Timestamp($event['~DATE_FROM']), false)));
    if ($event['RRULE']['UNTIL'] != CCalendar::GetMaxDate()) {
        $repeatHTML .= ' ' . GetMessage('EC_RRULE_UNTIL', array('#UNTIL_DATE#' => CCalendar::Date(CCalendar::Timestamp($event['RRULE']['UNTIL']), false)));
    }
    ?>
			<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 
}
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:template.php

示例2: GetMessage

        case 'MONTHLY':
            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'] != '' && $RRULE['UNTIL'] != CCalendar::GetMaxDate()) {
        $repeatHTML .= '<br>' . GetMessage('EC_RRULE_UNTIL', array('#UNTIL_DATE#' => CCalendar::Date(CCalendar::Timestamp($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 
}
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:template.php

示例3: UpdateReminders

 function UpdateReminders($Params = array())
 {
     $eventId = intVal($Params['id']);
     $reminders = $Params['reminders'];
     $arFields = $Params['arFields'];
     $userId = $Params['userId'];
     $bNew = $Params['bNew'];
     $path = $Params['path'];
     $path = CHTTP::urlDeleteParams($path, array("action", "sessid", "bx_event_calendar_request", "EVENT_ID"));
     $viewPath = CHTTP::urlAddParams($path, array('EVENT_ID' => $eventId));
     $remAgentParams = array('eventId' => $eventId, 'userId' => $arFields["CREATED_BY"], 'viewPath' => $viewPath, 'calendarType' => $arFields["CAL_TYPE"], 'ownerId' => $arFields["OWNER_ID"]);
     // 1. clean reminders
     if (!$bNew) {
         // if we edit event here can be "old" reminders
         CCalendar::RemoveAgent($remAgentParams);
     }
     // 2. Set new reminders
     $startTs = $arFields['DATE_FROM_TS_UTC'];
     // Start of the event in UTC
     $agentTime = 0;
     foreach ($reminders as $reminder) {
         $delta = intVal($reminder['count']) * 60;
         //Minute
         if ($reminder['type'] == 'hour') {
             $delta = $delta * 60;
         } elseif ($reminder['type'] == 'day') {
             $delta = $delta * 60 * 24;
         }
         //Day
         // $startTs - UTC timestamp;  date('Z', $startTs) - offset of the server
         $agentTime = $startTs + date('Z', $startTs);
         if ($agentTime - $delta >= time() - 60 * 5) {
             CCalendar::AddAgent(CCalendar::Date($agentTime - $delta), $remAgentParams);
         } elseif ($arFields['RRULE'] != '') {
             $arEvents = CCalendarEvent::GetList(array('arFilter' => array("ID" => $eventId, "DELETED" => "N", "FROM_LIMIT" => CCalendar::Date(time() - 3600, false), "TO_LIMIT" => CCalendar::GetMaxDate()), 'userId' => $userId, 'parseRecursion' => true, 'maxInstanceCount' => 2, 'preciseLimits' => true, 'fetchAttendees' => true, 'checkPermissions' => false, 'setDefaultLimit' => false));
             if ($arEvents && is_array($arEvents[0])) {
                 $nextEvent = $arEvents[0];
                 $startTs = CCalendar::Timestamp($nextEvent['DATE_FROM'], false, $arEvents[0]["DT_SKIP_TIME"] !== 'Y');
                 if ($nextEvent["DT_SKIP_TIME"] == 'N' && $nextEvent["TZ_FROM"]) {
                     $startTs = $startTs - CCalendar::GetTimezoneOffset($nextEvent["TZ_FROM"], $startTs);
                     // UTC timestamp
                 }
                 if ($startTs + date("Z", $startTs) < time() - 60 * 5 && $arEvents[1]) {
                     $nextEvent = $arEvents[1];
                 }
                 $startTs = CCalendar::Timestamp($nextEvent['DATE_FROM'], false, $arEvents[0]["DT_SKIP_TIME"] !== 'Y');
                 if ($nextEvent["DT_SKIP_TIME"] == 'N' && $nextEvent["TZ_FROM"]) {
                     $startTs = $startTs - CCalendar::GetTimezoneOffset($nextEvent["TZ_FROM"], $startTs);
                     // UTC timestamp
                 }
                 $reminder = $nextEvent['REMIND'][0];
                 if ($reminder) {
                     $delta = intVal($reminder['count']) * 60;
                     //Minute
                     if ($reminder['type'] == 'hour') {
                         $delta = $delta * 60;
                     } elseif ($reminder['type'] == 'day') {
                         $delta = $delta * 60 * 24;
                     }
                     //Day
                     // $startTs - UTC timestamp;  date("Z", $startTs) - offset of the server
                     $agentTime = $startTs + date("Z", $startTs);
                     if ($agentTime - $delta >= time() - 60 * 5) {
                         // Inaccuracy - 5 min
                         CCalendar::AddAgent(CCalendar::Date($agentTime - $delta), $remAgentParams);
                     }
                 }
             }
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:71,代码来源:calendar_event.php


注:本文中的CCalendar::GetMaxDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。