Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1.09 KB

README.md

File metadata and controls

37 lines (28 loc) · 1.09 KB

Yii2 Date Behavior

Installation

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.

Usage

    public function behaviors()
    {
        return [
            [
                'class' => \kolyasiryk\behaviors\DateBehavior::className(),
                'datetimeDisplayFormat' => 'php:d.m.Y H:i',
                'attributes' => [
                    'start_date' => 'datetime',
                    'end_date' => 'datetime',
                ],
            ],
        ];
    }