Skip to content

Releases: yii2mod/yii2-behaviors

2.0 Release

13 Jun 12:36
2d35266
Compare
Choose a tag to compare
  1. Upgrade carbon package to ^2.16
  2. Set minimum PHP version to 7.1.8

1.2 Release

22 Nov 16:00
Compare
Choose a tag to compare
  1. Added php-cs-fixer
  2. Fixed code style

1.1 Release

05 Jul 12:15
Compare
Choose a tag to compare

Date: Tuesday, July 5, 2016

  1. Added tests

1.0.1 Release

10 May 15:42
Compare
Choose a tag to compare

Date: Tuesday, May 10, 2016

Added CarbonBehavior that allows you to create a Carbon Instance for one or multiple attributes of an ActiveRecord
object when afterFind event happen.

  public function behaviors()
  {
      return [
          [
              'class' => CarbonBehavior::className(),
              'attributes' => [
                   'createdAt'
              ],
          ],
     ];
 }

 $user = UserModel::findOne(1);

 var_dump($user->createdAt->year); // 2016
 var_dump($user->createdAt->month); // 5
 var_dump($user->createdAt->day);  // 10

 // change date

 $user->createdAt->addYear();
 $user->save();

Initial release

21 Jul 14:12
Compare
Choose a tag to compare

Initial release