Well I can filter on any fields including the column from related fields, but I wonder how I can filter on date fields.
One solution I came across is date-picker for filter, I have not tested this, but my requirement is little different.
for example I have duplicated the datetime
column in gridview and formatted it like
[
'attribute'=>'discharge_date',
'format'=>['DateTime','php:M']
],
So that the column will show only months.The column is showing the months correctly.
Now I want to filter by month on this column. Any suggestion will be greatly appreciated. Thanks.
I did try like this
[
'attribute'=>'discharge_date',
'value'=>'discharge_date',
'filter' => ['2015-01'=>'Jan','2015-02'=>'Feb','2015-03'=>'Mar'],
'format'=>['DateTime','php:M']
],
This works fine, but here the year is being hard-coded, which I don't want. I know this is not the proper way. Thanks