sergmoro1 / yii2-ru-date
Behavior for Russian date.
Installs: 67
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-12-22 21:22:49 UTC
README
The Behavior class for operations with date fields in Russian format.
No more maintained, please use sergmoro1\yii2-ru-kit.
Installation
$ composer require sergmoro1/yii2-ru-date "dev-master"
Usage
You should define behavior in a Model class.
use sergmoro1\rudate\RuDate; class Post extends ActiveRecord { public function behaviors() { return [ 'RuDate' => ['class' => RuDate::className()] ]; }
And use it in appropriate place in a view.
<?= $model->getFullDate('created_at'); ?>
Only month and year.
<?= $model->getFullDate('created_at', 'M Y'); ?> // Фев 2018
Full month, day and year.
<?= $model->getFullDate('created_at', 'F d из t, Y (e)'); ?> // Февраль 13 из 28, 2018 (UTC)