From 86f529517533720991094b350e4fd8743a6dc3ba Mon Sep 17 00:00:00 2001 From: Ian Walls Date: Fri, 4 Mar 2016 14:31:22 -0500 Subject: [PATCH] Format dates in Blog Posts gridfield based on user preferences Instead of always formatting to DD/MM/YYYY as Nice() does, format the date based on user settings, using FormatFromSettings(). Fixes silverstripe/silverstripe-blog#384 --- code/forms/gridfield/GridFieldBlogPostState.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/forms/gridfield/GridFieldBlogPostState.php b/code/forms/gridfield/GridFieldBlogPostState.php index c9a49000..3d01ce49 100644 --- a/code/forms/gridfield/GridFieldBlogPostState.php +++ b/code/forms/gridfield/GridFieldBlogPostState.php @@ -34,7 +34,7 @@ public function getColumnContent($gridField, $record, $columnName) ' Saved as Draft on {date}', 'State for when a post is saved.', array( - 'date' => $lastEdited->Nice(), + 'date' => $lastEdited->FormatFromSettings(), ) ); } @@ -50,7 +50,7 @@ public function getColumnContent($gridField, $record, $columnName) ' Publish at {date}', 'State for when a post is published.', array( - 'date' => $publishDate->Nice(), + 'date' => $publishDate->FormatFromSettings(), ) ) . $modifiedLabel; } @@ -60,7 +60,7 @@ public function getColumnContent($gridField, $record, $columnName) ' Published on {date}', 'State for when a post is published.', array( - 'date' => $publishDate->Nice(), + 'date' => $publishDate->FormatFromSettings(), ) ) . $modifiedLabel; }