[core] feat: improve date rendering in html formatter (#2516)

This commit is contained in:
dag 2022-03-22 20:41:13 +01:00 committed by GitHub
parent ac8e94ec56
commit c87f4631f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,13 +45,14 @@ class HtmlFormat extends FormatAbstract {
$entryTitle = $this->sanitizeHtml(strip_tags($item->getTitle())); $entryTitle = $this->sanitizeHtml(strip_tags($item->getTitle()));
$entryUri = $item->getURI() ?: $uri; $entryUri = $item->getURI() ?: $uri;
$entryTimestamp = ''; $entryDate = '';
if($item->getTimestamp()) { if($item->getTimestamp()) {
$entryTimestamp = '<time datetime="'
. date(DATE_ATOM, $item->getTimestamp()) $entryDate = sprintf(
. '">' '<time datetime="%s">%s</time>',
. date(DATE_ATOM, $item->getTimestamp()) date('Y-m-d H:i:s', $item->getTimestamp()),
. '</time>'; date('Y-m-d H:i:s', $item->getTimestamp())
);
} }
$entryContent = ''; $entryContent = '';
@ -96,7 +97,7 @@ class HtmlFormat extends FormatAbstract {
<section class="feeditem"> <section class="feeditem">
<h2><a class="itemtitle" href="{$entryUri}">{$entryTitle}</a></h2> <h2><a class="itemtitle" href="{$entryUri}">{$entryTitle}</a></h2>
{$entryTimestamp} {$entryDate}
{$entryAuthor} {$entryAuthor}
{$entryContent} {$entryContent}
{$entryEnclosures} {$entryEnclosures}