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

{# TEMPLATE #}
<div id="sac-pager" class="pager">
  {% include "@atoms/form/button/button.twig" with {
    "outline": true,
    "text": "Previous",
    "size": "btn-lg",
    "icon_position": "left",
    "tag": "a",
    "url": "?date=#{prev_from}--#{prev_to}",
    "icon": "chevron-left",
    "class": "prev-month"
  } only %}
  <h2 class="month-name">{{ calendar_start|date('F Y') }}</h2>
  {% include "@atoms/form/button/button.twig" with {
    "outline": true,
    "text": "Next",
    "size": "btn-lg",
    "icon_position": "right",
    "tag": "a",
    "url": "?date=#{next_from}--#{next_to}",
    "icon": "chevron-right",
    "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 %}
