{# LIBRARIES #}
{{ attach_library('ui_patterns/sa_calendar.sa_calendar_lib') }}
{% import '@organisms/tm-sa/sa-calendar/calendar.macros.twig' as calendar_macros %}

{# VARIABLES #}
{% set btn_next_class = btn_next_class|default('btn btn-btn-lg btn-outline-default') %}
{% set btn_prev_class = btn_prev_class|default('btn btn-btn-lg btn-outline-default') %}

{# TEMPLATE #}
<div id="sac-pager" class="pager">
  {% include "@atoms/tm-links/standard/standard.twig" with {
    "text": "<i class='fas fa-chevron-left belil'></i> Previous",
    "url": "?date=#{prev_from}--#{prev_to}",
    "class": btn_prev_class ~ ' prev-month',
  } only %}
  <h2 class="month-name">{{ calendar_start|date('F Y') }}</h2>
  {% include "@atoms/tm-links/standard/standard.twig" with {
    "text": "Next <i class='fas fa-chevron-right belir'></i>",
    "url": "?date=#{next_from}--#{next_to}",
    "class": btn_next_class ~ ' next-month',
  } only %}
</div>

<div id="sac-calendar" class="dto">
  <ul id="days-row" class="ulc">
    <li class="lic title-cell">Sun</li>
    <li class="lic title-cell">Mon</li>
    <li class="lic title-cell">Tue</li>
    <li class="lic title-cell">Wed</li>
    <li class="lic title-cell">Thur</li>
    <li class="lic title-cell">Fri</li>
    <li class="lic title-cell">Sat</li>
  </ul>
  {{ calendar_macros.listDays(calendar_start|date('N'), calendar_start, calendar_end, count, alterations) }}
</div>

{% include '@organisms/tm-sa/sa-calendar/calendar-table.twig' with {
  'alterations': alterations,
  'title': 'Alterations for the month',
  'hide': true,
  'tid': 'calendar',
} only %}
