schmunk42\giiant\generators\crud\providers\extensions\DateProvider::columnFormat PHP Method

columnFormat() public method

.]ValueLabel function.
public columnFormat ( $attribute, $model ) : null | string
$model ActiveRecord
return null | string
    public function columnFormat($attribute, $model)
    {
        if (isset($this->generator->getTableSchema()->columns[$attribute])) {
            $column = $this->generator->getTableSchema()->columns[$attribute];
        } else {
            return;
        }
        if ($column->type != 'date') {
            return;
        }
        return <<<EOS
[
    'attribute'=>'{$attribute}',
    'format'=>'date',
    'filter' => '<div class="input-group drp-container">'
        .DateRangePicker::widget([
            'model' => \$searchModel,
            'attribute' => '{$attribute}_range',
            'presetDropdown'=>true,
            'convertFormat'=>true,
            'pluginOptions'=>[
                'locale'=>['format' => 'Y-m-d'],
                'showDropdowns'=>true
            ]
        ]).'</div>',                
]        
EOS;
    }