app/template/bravers/Block/apg_sc_two_month_calendar.twig line 1

Open in your IDE?
  1. {% set apgScThisMonth = apg_sc_get_month_days(0) %}
  2. {% set apgScNextMonth = apg_sc_get_month_days(1) %}
  3. <link rel="stylesheet" href="{{ asset('ECApgSimpleCalendar/assets/calendar.css', 'plugin') }}">
  4. <div class="calendarBlock">
  5.     <h2 class="titleBack">休日カレンダー</h2>
  6.     <div class="calendarBlock__inner">
  7.         <table class="apg_sc_table">
  8.             <tbody>
  9.             <tr>
  10.                 <th colspan="7" class="apg_sc_header">
  11.                     <span class="apg_sc_year">{{ apgScThisMonth['year'] }}</span>年<span
  12.                             class="apg_sc_month">{{ apgScThisMonth['month'] }}</span>月
  13.                 </th>
  14.             </tr>
  15.             <tr>
  16.                 <th class="apg_sc_sunday_header">日</th>
  17.                 <th class="apg_sc_monday_header">月</th>
  18.                 <th class="apg_sc_tuesday_header">火</th>
  19.                 <th class="apg_sc_wednesday_header">水</th>
  20.                 <th class="apg_sc_thursday_header">木</th>
  21.                 <th class="apg_sc_friday_header">金</th>
  22.                 <th class="apg_sc_saturday_header">土</th>
  23.             </tr>
  24.             {% for tr in apgScThisMonth['days'] %}
  25.                 <tr>
  26.                     {% for td in tr %}
  27.                         {% set apgCalendarClass = '' %}
  28.                         {% if loop.index == 7 %}
  29.                             {% set apgCalendarClass = 'apg_sc_saturday' %}
  30.                         {% elseif loop.index == 1 %}
  31.                             {% set apgCalendarClass = 'apg_sc_sunday' %}
  32.                         {% elseif loop.index == 2 %}
  33.                             {% set apgCalendarClass = 'apg_sc_monday' %}
  34.                         {% elseif loop.index == 3 %}
  35.                             {% set apgCalendarClass = 'apg_sc_tuesday' %}
  36.                         {% elseif loop.index == 4 %}
  37.                             {% set apgCalendarClass = 'apg_sc_wednesday' %}
  38.                         {% elseif loop.index == 5 %}
  39.                             {% set apgCalendarClass = 'apg_sc_thursday' %}
  40.                         {% elseif loop.index == 6 %}
  41.                             {% set apgCalendarClass = 'apg_sc_friday' %}
  42.                         {% endif %}
  43.                         {% if td.day == "now"|date('j') %}
  44.                             {% set apgCalendarClass = apgCalendarClass~' apg_sc_today' %}
  45.                         {% endif %}
  46.                         {% if td.holiday %}
  47.                             {% set apgCalendarClass = apgCalendarClass~' apg_sc_holiday' %}
  48.                         {% endif %}
  49.                         {% if td.day is empty %}
  50.                             {% set apgCalendarClass = apgCalendarClass~' apg_sc_non_day' %}
  51.                         {% endif %}
  52.                         <td title="{{ td.name }}" class="{{ apgCalendarClass }}">{{ td.day }}</td>
  53.                     {% endfor %}
  54.                 </tr>
  55.             {% endfor %}
  56.         </table>
  57.         <table class="apg_sc_table bt">
  58.             <tbody>
  59.             <tr>
  60.                 <th colspan="7" class="apg_sc_header">
  61.                     <span class="apg_sc_year">{{ apgScNextMonth['year'] }}</span>年<span
  62.                             class="apg_sc_month">{{ apgScNextMonth['month'] }}</span>月
  63.                 </th>
  64.             </tr>
  65.             <tr>
  66.                 <th class="apg_sc_sunday_header">日</th>
  67.                 <th class="apg_sc_monday_header">月</th>
  68.                 <th class="apg_sc_tuesday_header">火</th>
  69.                 <th class="apg_sc_wednesday_header">水</th>
  70.                 <th class="apg_sc_thursday_header">木</th>
  71.                 <th class="apg_sc_friday_header">金</th>
  72.                 <th class="apg_sc_saturday_header">土</th>
  73.             </tr>
  74.             {% for tr in apgScNextMonth['days'] %}
  75.                 <tr>
  76.                     {% for td in tr %}
  77.                         {% set apgCalendarClass = '' %}
  78.                         {% if loop.index == 7 %}
  79.                             {% set apgCalendarClass = 'apg_sc_saturday' %}
  80.                         {% elseif loop.index == 1 %}
  81.                             {% set apgCalendarClass = 'apg_sc_sunday' %}
  82.                         {% elseif loop.index == 2 %}
  83.                             {% set apgCalendarClass = 'apg_sc_monday' %}
  84.                         {% elseif loop.index == 3 %}
  85.                             {% set apgCalendarClass = 'apg_sc_tuesday' %}
  86.                         {% elseif loop.index == 4 %}
  87.                             {% set apgCalendarClass = 'apg_sc_wednesday' %}
  88.                         {% elseif loop.index == 5 %}
  89.                             {% set apgCalendarClass = 'apg_sc_thursday' %}
  90.                         {% elseif loop.index == 6 %}
  91.                             {% set apgCalendarClass = 'apg_sc_friday' %}
  92.                         {% endif %}
  93.                         {% if td.day == "now"|date('j') %}
  94.                             {% set apgCalendarClass = apgCalendarClass~' apg_sc_today' %}
  95.                         {% endif %}
  96.                         {% if td.holiday %}
  97.                             {% set apgCalendarClass = apgCalendarClass~' apg_sc_holiday' %}
  98.                         {% endif %}
  99.                         {% if td.day is empty %}
  100.                             {% set apgCalendarClass = apgCalendarClass~' apg_sc_non_day' %}
  101.                         {% endif %}
  102.                         <td title="{{ td.name }}" class="{{ apgCalendarClass }}">{{ td.day }}</td>
  103.                     {% endfor %}
  104.                 </tr>
  105.             {% endfor %}
  106.         </table>
  107.     </div>
  108. </div>