Pretty-time plugin
Dependency :
compile ":pretty-time:2.1.3.Final-1.0.1"
Summary
A plugin that allows you to display human readable, relative timestamps.
Installation
grails install-plugin pretty-time
Description
Requirements
- Grails 2.0 or above
- for Grails 1.x use version 0.3
Usage
<prettytime:display date="${someDate}" />"right now", "2 days ago", or "3 months from now"
Internationalization (I18n)
Build in - uses prettytime library translations. TagLib included in this plugin respects current locale.Tag attributes
| Attribute | Description |
|---|---|
| date | The date object to format. |
| capitalize | Capitalize the output text (default: false). Ex: "moments ago" -> "Moments ago". |
| showTime | Show the time (default: false). Ex: "2 days ago, 12:00:25 AM". |
| format | The format to use for the date (default: "hh:mm:ss a"). The default value is set by "default.date.format" in I18n. |
Version History
- 2.1.3.Final-1.0.1 - Small fix to "legacyResolve" which was introduced in Grails 2.1.3
- 2.1.3.Final-1.0 - Refactored. Updated pretty-time library to latest version of the lib (2.1.3). @Janusz Slota: many thanks for your contribution!
- 0.3 - Upgraded pretty-time library and added 2 tag attributes: "showTime" and "format".
- 0.2.1 - Fixed blank spaces.
- 0.2 - Added support for DateTime class of Joda-Time; added "capitalize" tag attribute.
- 0.1 - First official release.