mdxdave/time-ago
最新稳定版本:1.2.0
Composer 安装命令:
composer require mdxdave/time-ago
包简介
Displays the time has been past since a given date
README 文档
README
Displays time ago for a given timestamp value within a Craft CMS Twig template.
Requirements
This plugin requires Craft CMS 5.0.0 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project -
Then tell Composer to load the plugin:
composer require mdxdave/time-ago -
In the Control Panel, go to Settings → Plugins and click the “Install” button for TimeAgo.
Using TimeAgo
Just use the following code in your Twig template file:
{{ entry.postDate.getTimestamp()|timeAgo }}
If you want to use another language than english, use:
{{ entry.postDate.getTimestamp()|timeAgo("de") }}
Brought to you by MDXDave
统计信息
- 总下载量: 8.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-01