About TimeFormat

ProcessWire module formatting timestamps into human readable relative format (XY units ago)

Category 1SEO/Accessibility
Modules designed to help site accessibility, standards compliance and SEO.
Category 2Text Formatters
Textformatter modules that provide run-time formatting for blocks of text (typically used with Text/Textarea fields).
Category 3Other Modules
Modules that have a unique purpose not covered by existing categories.
Release StateStable
Should be safe for use in production environments. *
Authoradamkiss
Module Version1.0.3
Class NameToolsTimeFormat
Compatibility2.2
Date AddedJanuary 12, 2013
Recommended ByNew 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

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.