Skip to content

Commit

Permalink
Merge pull request #284 from marcokernler/locallized-archive-widget-t…
Browse files Browse the repository at this point in the history
…itles

i18n for the titles in the ArchiveWidget
  • Loading branch information
Damian Mooyman committed Aug 20, 2015
2 parents 3829149 + 60b575b commit 4e78e58
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions code/widgets/BlogArchiveWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,17 @@ public function getArchive() {
/**
* @var BlogPost $post
*/
$date = new Date();
$date->setValue($post->PublishDate);

if($this->ArchiveType == 'Yearly') {
$year = date('Y', strtotime($post->PublishDate));
$year = $date->FormatI18N("%Y");
$month = null;
$title = $year;
} else {
$year = date('Y', strtotime($post->PublishDate));
$month = date('m', strtotime($post->PublishDate));
$title = date('F Y', strtotime($post->PublishDate));
$year = $date->FormatI18N("%Y");
$month = $date->FormatI18N("%m");
$title = $date->FormatI18N("%B %Y");
}

$archive->push(new ArrayData(array(
Expand Down

0 comments on commit 4e78e58

Please sign in to comment.