kartik-v / yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.
http://demos.krajee.com/dynagrid
Other
74 stars 66 forks source link

Problem with DynaGrid date format #210

Closed YairHadari closed 5 years ago

YairHadari commented 5 years ago

Hi,

In the DB I have a datetime column in the format of yyyy-mm-dd hh:mm:ss. in DynaGrid I"m using the format of the column like that: 'format' => ['date', 'php:d-m-Y H:i:s']. The result is that one hour is being added to the DB value. When I"m using a date_default_timezone_set definition, three hours is being add to the DB value. How I can overcome it and display the correct DB value in the requested format?

[ 'attribute' => 'messageHistoryTime', 'format' => ['date', 'php:d-m-Y H:i:s'], 'filterType' => GridView::FILTER_DATE_RANGE, 'width' => '15%', 'filterWidgetOptions' => [ 'presetDropdown' => true, 'pluginOptions' => [ 'format' => 'DD-MM-YYYY', 'separator' => ' TO ', 'opens' => 'left', 'locale' => ['format' => 'DD-MM-YYYY'], ], 'pluginEvents' => [ "apply.daterangepicker" => "function() { apply_filter('messageHistoryTime') }", ] ], ],

Thanks in advance, Yair

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.