formatDate() public static method

Return formatted date information.
public static formatDate ( integer $date ) : string
$date integer Number of seconds since epoch we wish to display.
return string The date formatted pursuant to Horde prefs.
Exemplo n.º 1
0
try {
    $fl = $VC->getFile($where);
} catch (Horde_Vcs_Exception $e) {
    Chora::fatal($e);
}
/* Retrieve the desired revision from the GET variable. */
$rev = Horde_Util::getFormData('rev');
if (!$rev) {
    Chora::fatal(_("No revision specified"));
}
switch (Horde_Util::getFormData('actionID')) {
    case 'log':
        $VC->assertValidRevision($rev);
        $log = $fl->getLog($rev);
        if (!is_null($log)) {
            echo '<em>' . _("Author") . ':</em> ' . Chora::showAuthorName($log->getAuthor(), true) . '<br />' . '<em>' . _("Date") . ':</em> ' . Chora::formatDate($log->getDate()) . '<br /><br />' . Chora::formatLogMessage($log->getMessage());
        }
        exit;
}
if (!$VC->isValidRevision($rev)) {
    Chora::fatal(sprintf(_("Revision %s not found"), $rev), '404 Not Found');
}
try {
    $lines = $VC->annotate($fl, $rev);
} catch (Horde_Vcs_Exception $e) {
    Chora::fatal($e);
}
$title = sprintf(_("Source Annotation (revision %s) for:"), $rev);
$page_output->addScriptFile('annotate.js');
$page_output->addInlineJsVars(array('var Chora' => array('ANNOTATE_URL' => (string) Horde::url('annotate.php', true)->add(array('actionID' => 'log', 'rt' => $sourceroot, 'f' => $where, 'rev' => '')), 'loading_text' => _("Loading..."))));
Chora::header($title);
Exemplo n.º 2
0
    if (!isset($title)) {
        $title = _("Commits to:");
    }
}
try {
    $ps = $VC->getPatchset($ps_opts);
    $patchsets = $ps->getPatchsets();
} catch (Horde_Vcs_Exception $e) {
    Chora::fatal($e);
}
if (empty($patchsets)) {
    Chora::fatal(_("Commit Not Found"), '404 Not Found');
}
$page_output->addScriptFile('tables.js', 'horde');
$page_output->addScriptFile('quickfinder.js', 'horde');
Chora::header($title);
echo Chora::getHistoryViews($where)->render('patchsets');
require CHORA_TEMPLATES . '/patchsets/header_table.inc';
$diff_img = Horde::img('diff.png', _("Diff"));
reset($patchsets);
while (list($id, $patchset) = each($patchsets)) {
    $patchset_link = Chora::url('commit', $where, array('commit' => $id))->link(array('title' => $id)) . htmlspecialchars($VC->abbrev($id)) . '</a>';
    $commitDate = Chora::formatDate($patchset['date']);
    $readableDate = Chora::readableTime($patchset['date'], true);
    $author = Chora::showAuthorName($patchset['author'], true);
    $logMessage = Chora::formatLogMessage($patchset['log']);
    $tags = array_merge($patchset['branch'], $patchset['tags']);
    require CHORA_TEMPLATES . '/patchsets/ps.inc';
}
require CHORA_TEMPLATES . '/patchsets/footer.inc';
$page_output->footer();
Exemplo n.º 3
0
    }
    ?>
 </div>
<?php 
}
?>

 <div class="commit-message"><?php 
echo Chora::formatLogMessage($logMessage['log']);
?>
</div>

 <div class="commit-author">
  <div class="commit-author-avatar">
   <img src="http://www.gravatar.com/avatar/<?php 
echo md5(strtolower(trim(Chora::getAuthorEmail($logMessage['author']))));
?>
?d=mm&amp;s=40" />
  </div>
  <?php 
echo Chora::showAuthorName($logMessage['author'], true);
?>
<br />
  <?php 
echo Chora::formatDate($logMessage['date']);
?>
 </div>

 <div class="clear">&nbsp;</div>
</div>