From 030dd83613186080ae28e4d7a4ed984ced85938a Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 18 Aug 2017 15:24:03 +1200 Subject: [PATCH] using SS4 date formatting http://userguide.icu-project.org/formatparse/datetime --- code/GoogleSitemap.php | 2 +- templates/GoogleSitemapController_sitemap.ss | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 +