2017-12-05 4 views

Antwort

0

Sie erhalten aktuelles Datum im falschen Format,

einfach Ihren Code ändern, wie

[ 
    'attribute' => 'duedate', 
    'contentOptions' => function ($model, $key, $index, $column) { 
     $time = new \DateTime('now'); 
     $today = $time->format('Y-m-d H:i:s'); 
     return ['style' => 'background-color:' 
        . (strtotime($model->duedate) < strtotime($today) ? 'red' : 'white')]; 
    }, 
], 
+0

thank you very much :) –