Bug sitemap date format

This commit is contained in:
Fred Tempez 2024-01-13 13:33:57 +01:00
parent 470c017184
commit b403816c88

View File

@ -1074,7 +1074,7 @@ class common
foreach ($this->getData(['module', $parentPageId, 'posts']) as $articleId => $article) { foreach ($this->getData(['module', $parentPageId, 'posts']) as $articleId => $article) {
if ($this->getData(['module', $parentPageId, 'posts', $articleId, 'state']) === true) { if ($this->getData(['module', $parentPageId, 'posts', $articleId, 'state']) === true) {
$date = $this->getData(['module', $parentPageId, 'posts', $articleId, 'publishedOn']); $date = $this->getData(['module', $parentPageId, 'posts', $articleId, 'publishedOn']);
$sitemap->addUrl('/' . $parentPageId . '/' . $articleId, new DateTime("@{$date}", new DateTimeZone($timezone))); $sitemap->addUrl('/' . $parentPageId . '/' . $articleId, DateTime::createFromFormat('U', $date));
} }
} }
} }