{#
* Plugin Name : DeliveryDate4
*
* Copyright (C) BraTech Co., Ltd. All Rights Reserved.
* http://www.bratech.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
#}
<!--営業日カレンダー-->
{% set Date = get_date() %}
<div id="businessday_calendar">
<div class="calendar_title">営業日カレンダー</div>
<div class="note"><span></span>:店休日 <span></span>:本日</div>
{% set year = 'now'|date('Y') %}
{% for month, monthitem in Date %}
{% if loop.index0 > 0 and month == '1' %}
{% set year = year+1 %}
{% endif %}
<table>
<caption>{{ year }}年 {{ month }}月</caption>
<thead><tr><th id="sunday">日</th><th>月</th><th>火</th><th>水</th><th>木</th><th>金</th><th id="saturday">土</th></tr></thead>
<tbody>
{% for dayitem in monthitem %}
{% set day = dayitem.day %}
{% if day|date('j') == '1' %}
<tr>
{% if day|date('w') != '0' %}
{% for i in 1..day|date('w') %}
<td></td>
{% endfor %}
{% endif %}
{% elseif day|date('w') == 0 %}
<tr>
{% endif %}
{% set class = '' %}
{% if day|date('y/m/d') < 'now'|date('y/m/d') %}
{% set class = class ~ 'past' %}
{% endif %}
{% if day|date('y/m/d') == 'now'|date('y/m/d') %}
{% set class = class ~ 'today' %}
{% endif %}
{% if dayitem.is_holiday %}
{% if day|date('w') == 6 %}
{% set class = class ~ ' saturday holiday' %}
{% else %}
{% set class = class ~ ' sunday holiday' %}
{% endif %}
{% endif %}
<td {% if class != '' %} class="{{ class }}" {% endif %}>{{ day|date('j') }}</td>
{% if day|date('w') == 6 or loop.last %}
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{% endfor %}
</div>