PHP Class Zfplanet_View_Helper_TimeSince, ZFPlanet

Inheritance: extends Zend_View_Helper_Abstract
Show file Open project: padraic/ZFPlanet

Protected Properties

Property Type Description
$_now

Public Methods

Method Description
__construct ( )
timeSince ( string $date ) : integer Calculate number of days/hours/minutes since the provided date (must be ISO 8601 date).

Method Details

__construct() public method

public __construct ( )

timeSince() public method

Because this adds partial days, we just round the result up or down to get the closest number of "full" days/hours/minutes. Note that we only use ONE measure. If it's less than a day, we return hours. If less than an hour...
public timeSince ( string $date ) : integer
$date string ISO 8601 compatible date
return integer

Property Details

$_now protected property

protected $_now