Revision #10 has been created by Kartik V on Oct 19, 2014, 3:56:58 AM with the memo:
Change timestamp formats for Yii2 new i18n Formatter
« previous (#9)
Changes
Title
unchanged
Save and Display Date/Time Fields in different formats in Yii2
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
date, format, time, datetime, save, display, i18n, extension, date control, datecontrol, timestamp, events, behavior
Content
changed
[...]
```php
'formatter' => [
'class' => 'yii\i18n\Formatter',
'dateFormat' => 'php:d-M-Y',
'datetimeFormat' => '
php:d-M-Y H:i:s',
'timeFormat' => '
php:H:i:s',
]
```[...]
```php
class Setup {
const DATE_FORMAT = 'php:Y-m-d';
const DATETIME_FORMAT = '
php:Y-m-d H:i:s';
const TIME_FORMAT = '
php:H:i:s';
public static function convert($dateStr, $type='date', $format = null) {
if ($type === 'datetime') {
$fmt = ($format == null) ? self::DATETIME_FORMAT : $format;
}[...]