mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Merge pull request #284 from marcokernler/locallized-archive-widget-titles
i18n for the titles in the ArchiveWidget
This commit is contained in:
commit
4e78e581fd
@ -106,15 +106,17 @@ class BlogArchiveWidget extends Widget {
|
|||||||
/**
|
/**
|
||||||
* @var BlogPost $post
|
* @var BlogPost $post
|
||||||
*/
|
*/
|
||||||
|
$date = new Date();
|
||||||
|
$date->setValue($post->PublishDate);
|
||||||
|
|
||||||
if($this->ArchiveType == 'Yearly') {
|
if($this->ArchiveType == 'Yearly') {
|
||||||
$year = date('Y', strtotime($post->PublishDate));
|
$year = $date->FormatI18N("%Y");
|
||||||
$month = null;
|
$month = null;
|
||||||
$title = $year;
|
$title = $year;
|
||||||
} else {
|
} else {
|
||||||
$year = date('Y', strtotime($post->PublishDate));
|
$year = $date->FormatI18N("%Y");
|
||||||
$month = date('m', strtotime($post->PublishDate));
|
$month = $date->FormatI18N("%m");
|
||||||
$title = date('F Y', strtotime($post->PublishDate));
|
$title = $date->FormatI18N("%B %Y");
|
||||||
}
|
}
|
||||||
|
|
||||||
$archive->push(new ArrayData(array(
|
$archive->push(new ArrayData(array(
|
||||||
|
Loading…
Reference in New Issue
Block a user