Answer the question
In order to leave comments, you need to log in
How to set date format for all Yii2 GridView?
Hello. You need to set the date format for all GridViews to date
- Y-m-d
, and to dateTime
- Y-m-d | H.i.s
.
I tried to set the settings for the formatter in the settings of the application components:
'formatter' => [
'dateFormat' => 'php:Y-m-d',
'datetimeFormat' => 'php:Y-m-d | H.i.s',
],
'date:dateTime'
) Answer the question
In order to leave comments, you need to log in
Good evening.
Your setup works fine.
'formatter' => [
'class' => 'yii\i18n\Formatter',
'dateFormat' => 'dd MMMM yyyy',
'defaultTimeZone' => 'Europe/Kiev',
'datetimeFormat' => 'php: Y-m-d | H.i.s',
'locale' => 'ru'
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question