[Yii2] GridView date column format problem

Hi all, i find a strange problem, as you can see in image attachments

6088

yii2_gridview_date_problem.JPG

here is the GridView code:


            echo  GridView::widget([

                    'dataProvider' => $dataProvider,

                    'columns' => [

                        [

                            'attribute' => 'date_ini',

                            'format' => ['date', \Yii::$app->params['dateControlDisplay']['date']]

                        ],                        

                        'date_ini',

                        [

                            'attribute' => 'date_end',

                            'format' => ['date', 'php:d/m/Y']

                        ],                        

                        'date_end',

                    ],

                ]);



As you can see, i have 2 record in my db table. For the first row displayed (id=2) the date was correctly converted to the format specified.

For the second row (id=1) the convertions add 1 day to the original date in the db.

Can someone help me? I don’t know really what it can be.

Thank’s

Incredible. I see that now (at a different time) there is no error and the conversion works fine.

So i ask, it’s possible that, across the 24:00 to the 01:00 am, for some reason the conversion fails?

I set the same TimeZone in params.php:




                'dateControlDisplayTimezone'=>  'Europe/Rome',

                'dateControlSaveTimezone'=>  'Europe/Rome',



Thank’s for any help or suggestion

Ok, the problem was in DateControl and it’s fixed on the new release

For more info:

https://github.com/kartik-v/yii2-datecontrol/issues/29