mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
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
This commit is contained in:
parent
84efcf126b
commit
86f5295175
@ -34,7 +34,7 @@ class GridFieldBlogPostState extends GridFieldSiteTreeState
|
|||||||
'<i class="btn-icon gridfield-icon btn-icon-pencil"></i> Saved as Draft on {date}',
|
'<i class="btn-icon gridfield-icon btn-icon-pencil"></i> Saved as Draft on {date}',
|
||||||
'State for when a post is saved.',
|
'State for when a post is saved.',
|
||||||
array(
|
array(
|
||||||
'date' => $lastEdited->Nice(),
|
'date' => $lastEdited->FormatFromSettings(),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ class GridFieldBlogPostState extends GridFieldSiteTreeState
|
|||||||
'<i class="gridfield-icon blog-icon-timer"></i> Publish at {date}',
|
'<i class="gridfield-icon blog-icon-timer"></i> Publish at {date}',
|
||||||
'State for when a post is published.',
|
'State for when a post is published.',
|
||||||
array(
|
array(
|
||||||
'date' => $publishDate->Nice(),
|
'date' => $publishDate->FormatFromSettings(),
|
||||||
)
|
)
|
||||||
) . $modifiedLabel;
|
) . $modifiedLabel;
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ class GridFieldBlogPostState extends GridFieldSiteTreeState
|
|||||||
'<i class="btn-icon gridfield-icon btn-icon-accept"></i> Published on {date}',
|
'<i class="btn-icon gridfield-icon btn-icon-accept"></i> Published on {date}',
|
||||||
'State for when a post is published.',
|
'State for when a post is published.',
|
||||||
array(
|
array(
|
||||||
'date' => $publishDate->Nice(),
|
'date' => $publishDate->FormatFromSettings(),
|
||||||
)
|
)
|
||||||
) . $modifiedLabel;
|
) . $modifiedLabel;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user