A
A
Alexander Ivanov2016-03-15 12:20:29
1C-Bitrix
Alexander Ivanov, 2016-03-15 12:20:29

How to make buttons back and forth in the Bitrix calendar?

example https://partners.1c-bitrix.ru/infocenter/calendar.php
in off-documentation is empty dev.1c-bitrix.ru/api_help/main/reference/cmain/inc...
I try like this:

<?if($arResult["SHOW_MONTH_LIST"]):?> 
      <a href="<?=$arResult["PREV_MONTH_URL"]?>"."?"."<?=$arResult["PREV_MONTH_URL_TITLE"]?>" title="<?=$arResult["PREV_MONTH_URL_TITLE"]?>">Сюда <?=$arResult["NEXT_MONTH_URL_TITLE"]?></a>
      <a href="<?=$arResult["NEXT_MONTH_URL"]?>" title="<?=$arResult["NEXT_MONTH_URL_TITLE"]?>">Туда <?=$arResult["NEXT_MONTH_URL_TITLE"]?></a><?//=GetMessage("IBL_NEWS_CAL_PR_M")?>
    <?endif?>

so just take out the months
<?foreach($arResult["SHOW_MONTH_LIST"] as $month => $arOption):?>
            <li style="<?if($arResult["currentMonth"] !== $month) echo "";?>"><a href="<?=$arOption["VALUE"]?>"><?=$arOption["DISPLAY"]?></a></li>
      <?endforeach?>

At the output, it should display the name of the previous and next month.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pulse, 2016-03-24
@cimonlebedev

Component Calendar of events 2.0 (calendar.grid)
If you use the news component Calendar (news.calendar) , then in order for links to the previous and next month to appear, you need to change the component settings in the Additional settings section:
Date field: [TAMESTAMP_X] Last modified time or [DATE_CREATE] Creation date
Calendar type: Event

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question