kolyasiryk / yii2-date-behavior
This behavior makes it easy to save and to take date in correct format.
Package info
github.com/KolyaSirik/yii2-date-behavior
Type:yii2-behavior
pkg:composer/kolyasiryk/yii2-date-behavior
v1.0.5
2018-05-14 10:17 UTC
Requires
- php: >=7.0.0
- yiisoft/yii2: ^2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
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', ], ], ]; }