diff --git a/code/GoogleSitemap.php b/code/GoogleSitemap.php index 0a781df..5222c76 100644 --- a/code/GoogleSitemap.php +++ b/code/GoogleSitemap.php @@ -402,7 +402,7 @@ class GoogleSitemap ->limit($countPerFile, ($i - 1) * $countPerFile) ->last(); - $lastModified = ($sliced) ? $sliced->dbObject('LastEdited')->Format('Y-m-d') : date('Y-m-d'); + $lastModified = ($sliced) ? date('Y-m-d', strtotime($sliced->LastEdited)): date('Y-m-d'); $sitemaps->push(new ArrayData(array( 'ClassName' => $this->sanitiseClassName($class), diff --git a/templates/GoogleSitemapController_sitemap.ss b/templates/GoogleSitemapController_sitemap.ss index ffef3e6..106861a 100644 --- a/templates/GoogleSitemapController_sitemap.ss +++ b/templates/GoogleSitemapController_sitemap.ss @@ -4,9 +4,9 @@ <% loop $Items %> $AbsoluteLink - <% if $LastEdited %>$LastEdited.Format(c)<% end_if %> + <% if $LastEdited %>$LastEdited.Format(YYYY-MM-dd)<% end_if %> <% if $ChangeFrequency %>$ChangeFrequency<% end_if %> <% if $GooglePriority %>$GooglePriority<% end_if %> <% end_loop %> - \ No newline at end of file +