This commit is contained in:
Dennis Eichhorn 2017-10-02 09:49:15 +02:00
parent 7f327fad53
commit d397a8cea3

View File

@ -8,30 +8,32 @@ $calendar = $this->getData('calendar');
]
}
]'>
<ul class="weekdays green">
<li><?= $this->getHtml('Sunday'); ?>
<li><?= $this->getHtml('Monday'); ?>
<li><?= $this->getHtml('Tuesday'); ?>
<li><?= $this->getHtml('Wednesday'); ?>
<li><?= $this->getHtml('Thursday'); ?>
<li><?= $this->getHtml('Friday'); ?>
<li><?= $this->getHtml('Saturday'); ?>
</ul>
<?php $current = $calendar->getDate()->getMonthCalendar(0); $isActiveMonth = false;
for($i = 0; $i < 6; $i++) : ?>
<ul class="days">
<?php for($j = 0; $j < 7; $j++) :
$isActiveMonth = ((int) $current[$i*7+$j]->format('d') === 1) ? !$isActiveMonth : $isActiveMonth;
?>
<?php if($isActiveMonth) :?>
<li class="day<?= $calendar->hasEventOnDate($current[$i*7+$j]) ? ' has-event' : '';?>">
<div class="date"><?= $current[$i*7+$j]->format('d'); ?></div>
<?php else: ?>
<li class="day other-month<?= $calendar->hasEventOnDate($current[$i*7+$j]) ? ' has-event' : '';?>">
<div class="date"><?= $current[$i*7+$j]->format('d'); ?></div>
<?php endif; ?>
<?php endfor; ?>
</li>
</ul>
<?php endfor;?>
<div class="box wf-100">
<ul class="weekdays green">
<li><?= $this->getHtml('Sunday'); ?>
<li><?= $this->getHtml('Monday'); ?>
<li><?= $this->getHtml('Tuesday'); ?>
<li><?= $this->getHtml('Wednesday'); ?>
<li><?= $this->getHtml('Thursday'); ?>
<li><?= $this->getHtml('Friday'); ?>
<li><?= $this->getHtml('Saturday'); ?>
</ul>
<?php $current = $calendar->getDate()->getMonthCalendar(0); $isActiveMonth = false;
for($i = 0; $i < 6; $i++) : ?>
<ul class="days">
<?php for($j = 0; $j < 7; $j++) :
$isActiveMonth = ((int) $current[$i*7+$j]->format('d') === 1) ? !$isActiveMonth : $isActiveMonth;
?>
<?php if($isActiveMonth) :?>
<li class="day<?= $calendar->hasEventOnDate($current[$i*7+$j]) ? ' has-event' : '';?>">
<div class="date"><?= $current[$i*7+$j]->format('d'); ?></div>
<?php else: ?>
<li class="day other-month<?= $calendar->hasEventOnDate($current[$i*7+$j]) ? ' has-event' : '';?>">
<div class="date"><?= $current[$i*7+$j]->format('d'); ?></div>
<?php endif; ?>
<?php endfor; ?>
</li>
</ul>
<?php endfor;?>
</div>
</div>