本文整理汇总了PHP中CIBlockFormatProperties::DateFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockFormatProperties::DateFormat方法的具体用法?PHP CIBlockFormatProperties::DateFormat怎么用?PHP CIBlockFormatProperties::DateFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockFormatProperties
的用法示例。
在下文中一共展示了CIBlockFormatProperties::DateFormat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetDateFormat
public static function GetDateFormat($name, $parent)
{
global $DB;
$timestamp = mktime(7,30,45,2,22,2007);
return array(
"PARENT" => $parent,
"NAME" => $name,
"TYPE" => "LIST",
"SIZE" => 8,
"VALUES" => array(
"d-m-Y" => CIBlockFormatProperties::DateFormat("d-m-Y", $timestamp),//"22-02-2007",
"m-d-Y" => CIBlockFormatProperties::DateFormat("m-d-Y", $timestamp),//"02-22-2007",
"Y-m-d" => CIBlockFormatProperties::DateFormat("Y-m-d", $timestamp),//"2007-02-22",
"d.m.Y" => CIBlockFormatProperties::DateFormat("d.m.Y", $timestamp),//"22.02.2007",
"d.M.Y" => CIBlockFormatProperties::DateFormat("d.M.Y", $timestamp),//"22.Feb.2007",
"m.d.Y" => CIBlockFormatProperties::DateFormat("m.d.Y", $timestamp),//"02.22.2007",
"j M Y" => CIBlockFormatProperties::DateFormat("j M Y", $timestamp),//"22 Feb 2007",
"M j, Y" => CIBlockFormatProperties::DateFormat("M j, Y", $timestamp),//"Feb 22, 2007",
"j F Y" => CIBlockFormatProperties::DateFormat("j F Y", $timestamp),//"22 February 2007",
"f j, Y" => CIBlockFormatProperties::DateFormat("f j, Y", $timestamp),//"February 22, 2007",
"d.m.y g:i A" => CIBlockFormatProperties::DateFormat("d.m.y g:i A", $timestamp),//"22.02.07 1:30 PM",
"d.M.y g:i A" => CIBlockFormatProperties::DateFormat("d.M.y g:i A", $timestamp),//"22.Feb.07 1:30 PM",
"d.M.Y g:i A" => CIBlockFormatProperties::DateFormat("d.M.Y g:i A", $timestamp),//"22.Febkate.2007 1:30 PM",
"d.m.y G:i" => CIBlockFormatProperties::DateFormat("d.m.y G:i", $timestamp),//"22.02.07 7:30",
"d.m.Y H:i" => CIBlockFormatProperties::DateFormat("d.m.Y H:i", $timestamp),//"22.02.2007 07:30",
"SHORT" => GetMessage('COMP_PARAM_DATE_FORMAT_SITE'),
"FULL" => GetMessage('COMP_PARAM_DATETIME_FORMAT_SITE')
),
"DEFAULT" => $DB->DateFormatToPHP(CSite::GetDateFormat("SHORT")),
"ADDITIONAL_VALUES" => "Y",
);
}
示例2: GetMessage
?>
</div>
<div class="page-events-item__time <?php
echo $arItem['PREVIEW_PICTURE'] ? 'page-events-item__time_color_white' : '';
?>
"><?php
echo GetMessage('EVENTS_MAIN_FROM');
?>
<?php
echo CIBlockFormatProperties::DateFormat('H:i', MakeTimeStamp($arItem['ACTIVE_FROM'], @CSite::GetDateFormat()));
?>
<?php
echo GetMessage('EVENTS_MAIN_TO');
?>
<?php
echo CIBlockFormatProperties::DateFormat('H:i', MakeTimeStamp($arItem['ACTIVE_TO'], @CSite::GetDateFormat()));
?>
</div>
<div class="page-events-item__description <?php
echo $arItem['PREVIEW_PICTURE'] ? 'page-events-item__description_color_white' : '';
?>
">
<?php
echo $arItem['NAME'];
?>
</div>
</a>
</div>
<?endforeach;?>
<div class="clearfix"></div>
</div>
示例3: ReserveVideoRoom
public static function ReserveVideoRoom($Params)
{
$tst = MakeTimeStamp($Params['dateTo']);
if (date("H:i", $tst) == '00:00') {
$Params['dateTo'] = CIBlockFormatProperties::DateFormat(self::DFormat(true), $tst + (23 * 60 + 59) * 60);
}
$Params['VMiblockId'] = isset($Params['VMiblockId']) ? $Params['VMiblockId'] : self::$settings['vr_iblock_id'];
$check = CCalendar::CheckVideoRoom($Params);
if ($check !== true) {
return $check;
}
$sectionID = 0;
$dbItem = CIBlockSection::GetList(array(), array("IBLOCK_ID" => $Params['VMiblockId'], "ACTIVE" => "Y"));
if ($arItem = $dbItem->Fetch()) {
$sectionID = $arItem["ID"];
}
$arFields = array("IBLOCK_ID" => $Params['VMiblockId'], "IBLOCK_SECTION_ID" => $sectionID, "NAME" => $Params['name'], "DATE_ACTIVE_FROM" => $Params['dateFrom'], "DATE_ACTIVE_TO" => $Params['dateTo'], "CREATED_BY" => CCalendar::GetCurUserId(), "DETAIL_TEXT" => $Params['description'], "PROPERTY_VALUES" => array("PERIOD_TYPE" => 'NONE', "UF_PERSONS" => $Params['persons'], "MEMBERS" => $Params['members']), "ACTIVE" => "Y");
$bs = new CIBlockElement();
$id = $bs->Add($arFields);
return $id;
}
示例4: htmlspecialcharsbx
$arItem["DETAIL_PAGE_URL"] = htmlspecialcharsbx(str_replace(array("#SERVER_NAME#", "#SITE_DIR#", "#IBLOCK_ID#", "#SECTION_ID#", "#ELEMENT_ID#"), array(SITE_SERVER_NAME, SITE_DIR, $arItem["IBLOCK_ID"], $arItem["IBLOCK_SECTION_ID"], $arItem["ID"]), $arParams["DETAIL_URL"]));
}
if (array_key_exists("PREVIEW_PICTURE", $arItem)) {
$arItem["PREVIEW_PICTURE"] = CFile::GetFileArray($arItem["PREVIEW_PICTURE"]);
}
if (array_key_exists("DETAIL_PICTURE", $arItem)) {
$arItem["DETAIL_PICTURE"] = CFile::GetFileArray($arItem["DETAIL_PICTURE"]);
}
$arItem["FILE_EXTENTION"] = htmlspecialcharsbx(strtolower(strrchr($arItem['~NAME'], '.')));
$arItem["FIELDS"] = array();
foreach ($arParams["FIELD_CODE"] as $code) {
if (array_key_exists($code, $arItem)) {
$arItem["FIELDS"][$code] = $arItem[$code];
}
}
$arItem["FIELDS"]["TIMESTAMP_X"] = CIBlockFormatProperties::DateFormat($arParams["ACTIVE_DATE_FORMAT"], MakeTimeStamp($arItem["TIMESTAMP_X"], CSite::GetDateFormat()));
$arItem["DISPLAY_PROPERTIES"] = array();
if ($bGetProperty) {
$dbProps = CIBlockElement::GetProperty($arItem['IBLOCK_ID'], $arItem['ID'], array("sort" => "asc"));
if ($dbProps) {
while ($arProps = $dbProps->Fetch()) {
$arItem["PROPERTIES"][$arProps["CODE"]] = $arProps;
}
}
foreach ($arParams["PROPERTY_CODE"] as $pid) {
$prop =& $arItem["PROPERTIES"][$pid];
if (is_array($prop["VALUE"]) && count($prop["VALUE"]) > 0 || !is_array($prop["VALUE"]) && strlen($prop["VALUE"]) > 0) {
$arItem["DISPLAY_PROPERTIES"][$pid] = CIBlockFormatProperties::GetDisplayValue($arItem, $prop, "news_out");
}
}
}
示例5: MakeTimeStamp
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<div class="news-list-cnt">
<ul class="news-list">
<?foreach ($arResult["ITEMS"] as $key => $arItems) :?>
<?if ($key > 0 && $key%3 == 0):?>
</ul><ul class="news-list">
<?endif?>
<li>
<a href="<?=$arItems["~DETAIL_PAGE_URL"]?>">
<div class="img-cnt">
<img src="<?=CFile::GetPath($arItems["~PREVIEW_PICTURE"])?>" alt="" class="cover"/>
</div>
<div class="news-info">
<p class="news-date">
<?=CIBlockFormatProperties::DateFormat("H:i", MakeTimeStamp($arItems["ACTIVE_FROM"], FORMAT_DATETIME));?>,
<?=CIBlockFormatProperties::DateFormat("d F Y", MakeTimeStamp($arItems["ACTIVE_FROM"], FORMAT_DATETIME));?>
</p>
<p class="news-announce"><?=$arItems["NAME"]?></p>
</div>
</a>
</li>
<?endforeach?>
</ul>
</div>
<?if($arParams["DISPLAY_BOTTOM_PAGER"]):?>
<?=$arResult["NAV_STRING"]?>
<?endif;?>
示例6: array
$arButtons = CIBlock::GetPanelButtons($arIBlock["ID"], 0, 0, array("SECTION_BUTTONS" => false, "SESSID" => false));
$arIBlock["ADD_ELEMENT_LINK"] = $arButtons["edit"]["add_element"]["ACTION_URL"];
$arIBlock["~LIST_PAGE_URL"] = str_replace(array("#SERVER_NAME#", "#SITE_DIR#", "#IBLOCK_TYPE_ID#", "#IBLOCK_ID#", "#IBLOCK_CODE#", "#IBLOCK_EXTERNAL_ID#", "#CODE#"), array(SITE_SERVER_NAME, SITE_DIR, $arIBlock["IBLOCK_TYPE_ID"], $arIBlock["ID"], $arIBlock["CODE"], $arIBlock["EXTERNAL_ID"], $arIBlock["CODE"]), strlen($arParams["IBLOCK_URL"]) ? trim($arParams["~IBLOCK_URL"]) : $arIBlock["~LIST_PAGE_URL"]);
$arIBlock["~LIST_PAGE_URL"] = preg_replace("'/+'s", "/", $arIBlock["~LIST_PAGE_URL"]);
$arIBlock["LIST_PAGE_URL"] = htmlspecialcharsbx($arIBlock["~LIST_PAGE_URL"]);
$arIBlock["ITEMS"] = array();
$arrFilter["IBLOCK_ID"] = $arIBlock["ID"];
$rsItem = CIBlockElement::GetList($arOrder, $arrFilter, false, array("nTopCount" => $arParams["NEWS_COUNT"]), $arSelect);
$rsItem->SetUrlTemplates($arParams["DETAIL_URL"]);
while ($obItem = $rsItem->GetNextElement()) {
$arItem = $obItem->GetFields();
$arButtons = CIBlock::GetPanelButtons($arItem["IBLOCK_ID"], $arItem["ID"], 0, array("SECTION_BUTTONS" => false, "SESSID" => false));
$arItem["EDIT_LINK"] = $arButtons["edit"]["edit_element"]["ACTION_URL"];
$arItem["DELETE_LINK"] = $arButtons["edit"]["delete_element"]["ACTION_URL"];
if (strlen($arItem["ACTIVE_FROM"]) > 0) {
$arItem["DISPLAY_ACTIVE_FROM"] = CIBlockFormatProperties::DateFormat($arParams["ACTIVE_DATE_FORMAT"], MakeTimeStamp($arItem["ACTIVE_FROM"], CSite::GetDateFormat()));
} else {
$arItem["DISPLAY_ACTIVE_FROM"] = "";
}
$ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues($arItem["IBLOCK_ID"], $arItem["ID"]);
$arItem["IPROPERTY_VALUES"] = $ipropValues->getValues();
if (isset($arItem["PREVIEW_PICTURE"])) {
$arItem["PREVIEW_PICTURE"] = 0 < $arItem["PREVIEW_PICTURE"] ? CFile::GetFileArray($arItem["PREVIEW_PICTURE"]) : false;
if ($arItem["PREVIEW_PICTURE"]) {
$arItem["PREVIEW_PICTURE"]["ALT"] = $arItem["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_ALT"];
if ($arItem["PREVIEW_PICTURE"]["ALT"] == "") {
$arItem["PREVIEW_PICTURE"]["ALT"] = $arItem["NAME"];
}
$arItem["PREVIEW_PICTURE"]["TITLE"] = $arItem["IPROPERTY_VALUES"]["ELEMENT_PREVIEW_PICTURE_FILE_TITLE"];
if ($arItem["PREVIEW_PICTURE"]["TITLE"] == "") {
$arItem["PREVIEW_PICTURE"]["TITLE"] = $arItem["NAME"];
示例7: formatDate
/**
* Convert dates if date template set
* @param mixed[] $arr data array to be converted
* @param string[] $conversion contains sublist of keys of $arr, that will be converted
* @return void
*/
protected function formatDate(&$arr, $conversion)
{
if (strlen($this->arParams['ACTIVE_DATE_FORMAT']) && self::isNonemptyArray($conversion)) {
foreach ($conversion as $fld) {
if (!empty($arr[$fld])) {
$arr[$fld . "_FORMATED"] = CIBlockFormatProperties::DateFormat($this->arParams['ACTIVE_DATE_FORMAT'], MakeTimeStamp($arr[$fld]));
}
}
}
}
示例8: LocalRedirect
break;
}
}
LocalRedirect($APPLICATION->GetCurDir() . '#comment' . intval($_REQUEST['id']));
}
/* delete comment */
if ($delete_comment = $_REQUEST['delete_comment']) {
foreach ($arResult['COMMENTS'] as $comment) {
if ($comment['ID'] == $delete_comment) {
if ($comment['CREATED_BY'] == $arResult['USER_ID']) {
$el = new CIBlockElement();
$res = $el->Update($delete_comment, array("ACTIVE" => 'N'));
crmEntitiesHelper::recalcCommentsCnt($arParams['ID']);
$logger->add(array($arResult['TASK']['PROPS']['CUSTOMER']['VALUE'], $arResult['TASK']['PROPS']['PROGRAMMER']['VALUE']), $arParams['ID'], 'delete_comment', strip_tags($comment['~PREVIEW_TEXT']));
ToolTip::Add('Комментарий удалён');
crmEntitiesHelper::RecalcLastCommentDateTime($arParams['ID']);
} else {
ToolTip::AddError('Ошибка доступа к комментарию');
}
break;
}
}
LocalRedirect($APPLICATION->GetCurDir());
}
/* tracking time */
$res = CIBlockElement::GetList(array("ID" => "ASC"), array("PROPERTY_TASK" => $arParams['ID'], "IBLOCK_ID" => TRACKING_IBLOCK_ID, "ACTIVE" => "Y"), false, false, array('DETAIL_TEXT', 'ID', 'DATE_CREATE', 'PROPERTY_HOURS'));
while ($ar_fields = $res->GetNext()) {
$ar_fields['DATE_CREATE'] = CIBlockFormatProperties::DateFormat($arParams['DATE_FORMAT'], MakeTimeStamp($ar_fields['DATE_CREATE'], CSite::GetDateFormat()));
$arResult['TRACKING'][] = $ar_fields;
}
$this->IncludeComponentTemplate();
示例9: array
">
<div class="header">
<div class="author">
<div class="avatar">
<img alt="image" src="<?php
$avatar = CFile::ResizeImageGet($arItem["PROPERTIES"]["AVATAR"]["VALUE"], array("width" => 57, "height" => 57), BX_RESIZE_IMAGE_EXACT);
echo $avatar["src"];
?>
">
</div>
<h2 class="name"><a href="#"><?php
echo $arItem["NAME"];
?>
</a></h2>
<em class="date"><?php
echo CIBlockFormatProperties::DateFormat("d F Y H:i:s", MakeTimeStamp($arItem["DATE_CREATE"], CSite::GetDateFormat()));
?>
</em>
</div>
<div class="votes">
<a href="javascript:void(0)" id="<?php
echo $arItemIDs["VOTE_PLUS"];
?>
" class="vote plus"><?php
echo intval($arItem["PROPERTIES"]["VOTE_PLUS"]["VALUE"]);
?>
</a>
<a href="javascript:void(0)" id="<?php
echo $arItemIDs["VOTE_MINUS"];
?>
" class="vote minus"><?php
示例10: number_format
$html .= '</td>';
$html .= '</tr>';
$html .= '</table>';
$html .= '<br>';
$html .= '<p>Итого к оплате без НДС*: ' . number_format($_SESSION["ORDER_ITEM"]['price'], 0, '.', ' ') . ' (' . Number2Word_Rus($_SESSION["ORDER_ITEM"]['price'], 'N') . ') белорусских рублей.</p>';
$html .= '<p style="font-size:80%;">* Стоимость услуг указана без НДС, Исполнитель является плательщиком налогов по УСН.</p>';
$html .= '<table style="width:100%;">';
$html .= '<tr>';
$html .= '<td style="width:50%;background:url(/bitrix/templates/goodidea/images/pechat.jpg) no-repeat 0 0;height:190px;padding-left:70px;vertical-align:top;">';
$html .= '';
$html .= '<p>Исполнитель:</p>';
$html .= '<br><br><br><br>';
$html .= '<p>________________ Р.В. Нестерович</p>';
$html .= '<p>м.п.</p>';
$html .= '<br><br>';
$html .= '<p>' . CIBlockFormatProperties::DateFormat('«j» F Y', time()) . 'г.</p>';
$html .= '</td>';
$html .= '<td style="width:50%;height:190px;padding-left:70px;vertical-align:top;">';
$html .= '';
$html .= '<p>Заказчик:</p>';
$html .= '<br><br><br><br>';
$html .= '<p>________________ ' . $_POST['posContractLName'] . ' ' . $_POST['posContractFName'] . '</p>';
$html .= '<p>м.п.</p>';
$html .= '<br><br>';
$html .= '<p>«___» __________ 201_ г.</p>';
$html .= '</td>';
$html .= '</tr>';
$html .= '</table>';
include $_SERVER['DOCUMENT_ROOT'] . "/mpdf60/mpdf.php";
$mpdf = new mPDF();
$mpdf->charset_in = 'cp1251';
示例11: GetDateFormat
function GetDateFormat($name, $parent)
{
global $DB;
$timestamp = mktime(7, 30, 45, 2, 22, 2007);
return array("PARENT" => $parent, "NAME" => $name, "TYPE" => "LIST", "VALUES" => array("d-m-Y" => CIBlockFormatProperties::DateFormat("d-m-Y", $timestamp), "m-d-Y" => CIBlockFormatProperties::DateFormat("m-d-Y", $timestamp), "Y-m-d" => CIBlockFormatProperties::DateFormat("Y-m-d", $timestamp), "d.m.Y" => CIBlockFormatProperties::DateFormat("d.m.Y", $timestamp), "d.M.Y" => CIBlockFormatProperties::DateFormat("d.M.Y", $timestamp), "m.d.Y" => CIBlockFormatProperties::DateFormat("m.d.Y", $timestamp), "j M Y" => CIBlockFormatProperties::DateFormat("j M Y", $timestamp), "M j, Y" => CIBlockFormatProperties::DateFormat("M j, Y", $timestamp), "j F Y" => CIBlockFormatProperties::DateFormat("j F Y", $timestamp), "f j, Y" => CIBlockFormatProperties::DateFormat("f j, Y", $timestamp), "d.m.y g:i A" => CIBlockFormatProperties::DateFormat("d.m.y g:i A", $timestamp), "d.M.y g:i A" => CIBlockFormatProperties::DateFormat("d.M.y g:i A", $timestamp), "d.M.Y g:i A" => CIBlockFormatProperties::DateFormat("d.M.Y g:i A", $timestamp), "d.m.y G:i" => CIBlockFormatProperties::DateFormat("d.m.y G:i", $timestamp), "d.m.Y H:i" => CIBlockFormatProperties::DateFormat("d.m.Y H:i", $timestamp), "SHORT" => GetMessage('COMP_PARAM_DATE_FORMAT_SITE'), "FULL" => GetMessage('COMP_PARAM_DATETIME_FORMAT_SITE')), "DEFAULT" => $DB->DateFormatToPHP(CSite::GetDateFormat("SHORT")), "ADDITIONAL_VALUES" => "Y");
}
示例12: formatDisplayDate
public static function formatDisplayDate($date, $format)
{
if (empty($date)) {
return '';
} else {
return \CIBlockFormatProperties::DateFormat($format, MakeTimeStamp($date, \CSite::GetDateFormat()));
}
}
示例13: GetMessage
<?php
if ($code == "SHOW_COUNTER") {
?>
<div class="bx-newslist-view"><i class="fa fa-eye"></i> <?php
echo GetMessage("IBLOCK_FIELD_" . $code);
?>
:
<?php
echo intval($value);
?>
</div>
<?php
} elseif ($value && ($code == "SHOW_COUNTER_START" || $code == "DATE_ACTIVE_FROM" || $code == "ACTIVE_FROM" || $code == "DATE_ACTIVE_TO" || $code == "ACTIVE_TO" || $code == "DATE_CREATE" || $code == "TIMESTAMP_X")) {
?>
<?php
$value = CIBlockFormatProperties::DateFormat($arParams["ACTIVE_DATE_FORMAT"], MakeTimeStamp($value, CSite::GetDateFormat()));
?>
<div class="bx-newslist-date"><i class="fa fa-calendar-o"></i> <?php
echo GetMessage("IBLOCK_FIELD_" . $code);
?>
:
<?php
echo $value;
?>
</div>
<?php
} elseif ($code == "TAGS" && $value) {
?>
<div class="bx-newslist-tags"><i class="fa fa-tag"></i> <?php
echo GetMessage("IBLOCK_FIELD_" . $code);
?>
示例14: ReserveVR
function ReserveVR($Params)
{
$tst = MakeTimeStamp($Params['dateTo']);
if (date("H:i", $tst) == '00:00') {
$Params['dateTo'] = CIBlockFormatProperties::DateFormat(getDateFormat(true), $tst + (23 * 60 + 59) * 60);
}
//$maxUsers = COption::GetOptionInt("video", "video-room-users", 6);
//if(count($Params['members']) > $maxUsers)
// return "max_users_".$maxUsers;
$check = CEventCalendar::CheckVR($Params);
if ($check !== true) {
return $check;
}
$sectionID = 0;
$dbItem = CIBlockSection::GetList(array(), array("IBLOCK_ID" => $Params['VMiblockId'], "ACTIVE" => "Y"));
if ($arItem = $dbItem->Fetch()) {
$sectionID = $arItem["ID"];
}
$arFields = array("IBLOCK_ID" => $Params['VMiblockId'], "IBLOCK_SECTION_ID" => $sectionID, "NAME" => $Params['name'], "DATE_ACTIVE_FROM" => $Params['dateFrom'], "DATE_ACTIVE_TO" => $Params['dateTo'], "CREATED_BY" => $GLOBALS["USER"]->GetID(), "DETAIL_TEXT" => $Params['description'], "PROPERTY_VALUES" => array("UF_PERSONS" => $Params['persons'], "PERIOD_TYPE" => $Params['regularity'], "PERIOD_COUNT" => $Params['regularity_count'], "EVENT_LENGTH" => $Params['regularity_length'], "PERIOD_ADDITIONAL" => $Params['regularity_additional'], "MEMBERS" => $Params['members']), "ACTIVE" => "Y");
$bs = new CIBlockElement();
$id = $bs->Add($arFields);
return $id;
}
示例15: formatDate
/**
* Convert dates if date template set
* @param mixed[] array that date conversion performs in
* @return void
*/
protected function formatDate(&$arr)
{
if (strlen($this->arParams['ACTIVE_DATE_FORMAT'])) {
foreach ($this->orderDateFields2Convert as $fld) {
if (!empty($arr[$fld])) {
$arr[$fld . "_FORMATED"] = CIBlockFormatProperties::DateFormat($this->arParams['ACTIVE_DATE_FORMAT'], MakeTimeStamp($arr[$fld]));
}
}
}
}