- Small work done on calendar widget

This commit is contained in:
Dave M. 2024-11-21 19:15:39 -05:00
parent 163df3f4ba
commit 07613bf1cb
1 changed files with 4 additions and 2 deletions

View File

@ -31,15 +31,17 @@
{% foreach range(0, 5) as $week %} {% foreach range(0, 5) as $week %}
<div class="week"> <div class="week">
{% foreach range(0, 6) as $day %} {% foreach range(0, 6) as $day %}
{% php $dayType = in_array($day, [0, 6]) ? 'week-end' : 'week-day' %}
{% if ( $week * 6 + $day >= $index ) && ( $currentDay < $dayCount ) %} {% if ( $week * 6 + $day >= $index ) && ( $currentDay < $dayCount ) %}
{% php $currentDay++; %} {% php $currentDay++; %}
{% slot "day.content", new \DateTime("$year-$month-$currentDay"), date("$year-$month-$currentDay") === date('Y-n-j') %} {% slot "day.content", new \DateTime("$year-$month-$currentDay"), date("$year-$month-$currentDay") === date('Y-n-j') %}
<div class="day-box {{ $today ? 'today' : '' }}">{{ $date->format('d') }}</div> <div class="day-box {{ $today ? 'today' : '' }} {{ $dayType }}">{{ $date->format('d') }}</div>
{% endslot %} {% endslot %}
{% else %} {% else %}
{% slot "day.empty", $day, $month, $year %} {% slot "day.empty", $day, $month, $year %}
<div class="day-box"></div> <div class="day-box {{ $dayType }}"></div>
{% endslot %} {% endslot %}
{% endif %} {% endif %}
{% endforeach %} {% endforeach %}