https://github.com/davidhirtz/yii2-timeago
Display relative dates in your Yii 2 views
https://github.com/davidhirtz/yii2-timeago
timeago yii2-extension
Last synced: about 2 months ago
JSON representation
Display relative dates in your Yii 2 views
- Host: GitHub
- URL: https://github.com/davidhirtz/yii2-timeago
- Owner: davidhirtz
- License: mit
- Created: 2015-12-02T13:50:20.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-12-26T09:19:49.000Z (6 months ago)
- Last Synced: 2025-02-21T07:17:35.977Z (4 months ago)
- Topics: timeago, yii2-extension
- Language: PHP
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Yii 2 Timeago
==========================
Used to display auto-updating, translated relative dates (e.g. "3 minutes ago") HTML tags using a custom web component.
For the previous version build on jQuery, use the version `v1.2.0` constraint in your `composer.json`.Installation
------------```
composer require davidhirtz/yii2-timeago "^2.1"
```Usage
-----Once the extension is installed, simply use it in your view like this:
```php
= \davidhirtz\yii2\timeago\Timeago::tag(time()); ?>
```Or use the column helper class in your `\yii\grid\GridView`:
```php
[
'attribute' => 'created_at',
'class' => \davidhirtz\yii2\timeago\TimeAgoColumn::class,
],
```