the background of the days are changed in the calendar

This commit is contained in:
iironside
2022-03-08 14:51:10 +03:00
parent e55583a44d
commit 46a62c300e
6 changed files with 2102 additions and 2 deletions

View File

@ -6,7 +6,7 @@ $this->title = 'Календарь ДР';
?>
<?= \backend\widgets\Calendar::widget([
'css' => '.success{color: orange;}',
'css' => '.success{color: green;}',
'button' => Html::a('<i class="fa fa-table" aria-hidden="true"></i> Таблица',
['table'], ['class' => 'btn btn-primary',]),

View File

@ -378,6 +378,14 @@
cursor: pointer;
}
.fully_day {
background-color: #99ff99;
}
.empty_day {
background-color: #ff9999;
}
.active_day {
background: #cdcfce;
}

View File

@ -384,6 +384,14 @@
cursor: pointer;
}
.fully_day {
background-color: #99ff99;
}
.empty_day {
background-color: #ff9999;
}
.active_day {
background: #cdcfce;
}

View File

@ -151,7 +151,15 @@ class CalendarHelper {
}
static _getCalendarDay(dayNum, className = ``, color = ``) {
return `<div class="calendar__day ${className}">
let day = ''
if (color === 'danger' && className !== 'inactive') {
day = 'empty_day'
}
else if (color === 'success' && className !== 'inactive') {
day = 'fully_day'
}
return `<div class="calendar__day ${className} ${day} ">
<span class="calendar__date ${color}">${dayNum}</span>
</div>`;
}