getAgo() public method

public getAgo ( mixed $date ) : string
$date mixed The date to calculate the difference from. Can be either a timestamp integer value, or an array with date parts: 'day', 'month', 'year'.
return string
Esempio n. 1
0
 protected function _renderVarDisplay_datetime($form, &$var, &$vars)
 {
     $value = $var->getValue($vars);
     $html = htmlspecialchars($var->type->formatDate($value));
     if (!$var->type->emptyDateArray($value)) {
         $html .= Horde_Form_Type_date::getAgo($value);
     }
     return $html;
 }
Esempio n. 2
0
 function getFormattedTime($timestamp, $format = null, $showago = true)
 {
     if (empty($format)) {
         $format = $this->_format;
     }
     if (!empty($timestamp)) {
         return strftime($format, $timestamp) . ($showago ? Horde_Form_Type_date::getAgo($timestamp) : '');
     } else {
         return '';
     }
 }
Esempio n. 3
0

<?php 
    echo _("Ticket #");
    echo $ticket['id'];
    ?>
: <?php 
    echo $ticket['summary'];
    ?>

<?php 
    echo _("Opened:");
    ?>
 <?php 
    echo strftime('%a %d %B', $ticket['timestamp']);
    echo Horde_Form_Type_date::getAgo($ticket['timestamp']);
    ?>

<?php 
    echo _("State:");
    ?>
 <?php 
    echo $ticket['state_name'];
    ?>

<?php 
    echo _("Link:");
    ?>
 <?php 
    echo $ticket['link'];
}