The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability
settings for your application's composer.json.
To install, either run
$ php composer.phar require kolyasiryk/yii2-date-behavior "*"
or add
"kolyasiryk/yii2-date-behavior": "*"
to the require
section of your composer.json
file.
public function behaviors()
{
return [
[
'class' => \kolyasiryk\behaviors\DateBehavior::className(),
'datetimeDisplayFormat' => 'php:d.m.Y H:i',
'attributes' => [
'start_date' => 'datetime',
'end_date' => 'datetime',
],
],
];
}