mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
FIX Display individual years in blog archive widget when set to "Yearly"
This commit is contained in:
parent
4aa468a6ab
commit
27044d86a5
@ -105,14 +105,15 @@ class BlogArchiveWidget extends Widget
|
||||
$posts = $query->execute();
|
||||
$result = new ArrayList();
|
||||
while ($next = $posts->next()) {
|
||||
$date = Date::create();
|
||||
$date->setValue(strtotime($next['PublishDate']));
|
||||
$year = $date->Format('Y');
|
||||
|
||||
if ($this->ArchiveType == 'Yearly') {
|
||||
$year = $next['PublishDate'];
|
||||
$month = null;
|
||||
$title = $year;
|
||||
} else {
|
||||
$date = Date::create();
|
||||
$date->setValue(strtotime($next['PublishDate']));
|
||||
|
||||
$year = $date->Format('Y');
|
||||
$month = $date->Format('m');
|
||||
$title = $date->FormatI18N('%B %Y');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user