About TimeFormat
ProcessWire module formatting timestamps into human readable relative format (XY units ago)
Category 1 | SEO/Accessibility Modules designed to help site accessibility, standards compliance and SEO. |
---|---|
Category 2 | Text Formatters Textformatter modules that provide run-time formatting for blocks of text (typically used with Text/Textarea fields). |
Category 3 | Other Modules Modules that have a unique purpose not covered by existing categories. |
Release State | Stable Should be safe for use in production environments. * |
Author | |
Module Version | 1.0.3 |
Class Name | ToolsTimeFormat |
Compatibility | 2.2 |
Date Added | January 12, 2013 |
Recommended By | New recommendations may take up to 1 day to appear. |
Instructions
This module's files should be placed in /site/modules/ToolsTimeFormat/
How to install or uninstall modules
README
TimeFormat for ProcessWire v1.0.3
This is a tiny ProcessWire Modules used for formatting times as 'X seconds ago', 'minutes ago'. It goes up to decades.
Important note: this module uses 'soft limit' for units. That means that it will show '8 days ago' for 8 days, but '1 week ago' for 9 days, for instance. This will be configurable in one of the later releases.
Requirements
- ProcessWire 2.2
- PHP 5.3+
Usage
It's very simple. Load module, pass the timestamp to format
function. Bam, done.
$time_format = $modules->get('ToolsTimeFormat');
$posted = $time_format->ago($page->created);
History
v1.0.3 – 2013-01-12
This module has been renamed to TimeFormat, to accomodat future functionality better. Sorry for any inconvenience.
v1.0.2 – 2013-01-12
- fix – fixed translation possibilities (include only format string in
_()
call)
Credits
- Created by Adam Kiss 2013
- Calculation is a much improved function found at css-tricks.com
- License used is WTFPL
Comments
No comments yet. Be the first to post!
Post a Comment
Your e-mail is kept confidential and not included with your comment. Website is optional.
- Admin Helpers
- Core Modules
- Development Tools
- Field Types
- File Validator
- Import/Export
- Input Fields
- Language Modules
- Language Packs
- Logs/Monitoring
- Markup Generation
- Photo/Video/Audio
- Premium Modules
- Process Modules
- Proof of Concept
- SEO/Accessibility
- Site Profiles
- Social, Feeds, Services
- Text Formatters
- Other Modules
- Users and Access
Disclaimer
*Use modules at your own risk. There are no guarantees or warranties. It is recommended that you backup your site and database before installing new modules.