Skip to content

This package calculates the time since a specific DateTime object and displays it in a human readable format.

Notifications You must be signed in to change notification settings

Commentar/TimeAgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TimeAgo

Build Status Scrutinizer Quality Score Code Coverage Latest Stable Version Total Downloads

Date renderer for the Commentar project. This package calculates the time since a specific DateTime object en displays it in a human readable format. E.g. 5 minutes ago.

The supported steps are:

  • seconds
  • minutes
  • hours
  • days
  • weeks
  • months
  • years

It is installed by default when first installing the Commentar system.

Installation

If you are running a standard installation of Commentar you don't have to install anything (it is the default timestamp formatter of the system).

Add the formatter to the project's composer.json file:

"require": {
    "commentar/time-ago": "0.0.*",
}

Use it in your templates:

<?php echo $this->renderView('TimeAgo', ['timestamp' => $comment['updated']]); ?>

About

This package calculates the time since a specific DateTime object and displays it in a human readable format.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages