<?php
/* @var $timeTable TimeTableMonth */

use common\models\Event;
use common\modules\event\models\timetable\TimeTableMonth;
use common\modules\event\models\timetable\TimeTableMonthDay;
use common\modules\event\models\timetable\TimeTableMonthWeek;
use common\modules\event\widgets\day\TimeTableMonthDayView;
use common\modules\event\widgets\event\EventView;
use common\modules\event\widgets\timetable\TimeTableMonthView;
use yii\grid\ActionColumn;
use yii\grid\GridView;


$columns = [
    [
        'attribute' => 'weekNumber',
        'label' => '',
        'value' =>  static function ($model,$key){
            return  $model->weekNumber;
        }
    ],
    [
        'attribute' => 'monday',
        'label' => 'Hétfő',
        'format' => 'raw',
        'value' =>  TimeTableMonthView::renderDay('monday')
    ],
    [
        'attribute' => 'tuesday',
        'label' => 'Kedd',
        'format' => 'raw',
        'value' =>  TimeTableMonthView::renderDay('tuesday')
    ],

    [
        'attribute' => 'wednesday',
        'label' => 'Szerda',
        'format' => 'raw',
        'value' =>  TimeTableMonthView::renderDay('wednesday')
    ],
    [
        'attribute' => 'thursday',
        'label' => 'Csütörtök',
        'format' => 'raw',
        'value' =>  TimeTableMonthView::renderDay('thursday')
    ],
    [
        'attribute' => 'friday',
        'label' => 'Péntek',
        'format' => 'raw',
        'value' =>  TimeTableMonthView::renderDay('friday')
    ],
    [
        'attribute' => 'saturday',
        'format' => 'raw',
        'label' => 'Szombat',
        'value' =>  TimeTableMonthView::renderDay('saturday')
    ],
    [
        'attribute' => 'Sunday',
        'label' => 'Vasárnap',
        'format' => 'raw',
        'value' =>  TimeTableMonthView::renderDay('sunday')
    ],
];

if ( isset($actionsColumn)){
    $columns[] = $actionsColumn;
}

?>
<?= GridView::widget([
    'dataProvider' => $timeTable->getWeeksArrayDataProvider(),
    'layout' => '{items}',
    'columns' => $columns,
]) ?>
