diff --git a/code/compat/pages/BlogEntry.php b/code/compat/pages/BlogEntry.php index 0724396..7068752 100644 --- a/code/compat/pages/BlogEntry.php +++ b/code/compat/pages/BlogEntry.php @@ -38,7 +38,7 @@ class BlogEntry extends BlogPost implements MigratableObject { //Migrate comma separated tags into BlogTag objects. foreach($this->TagNames() as $tag) { - $existingTag = BlogTag::get()->filter('Title', $tag); + $existingTag = BlogTag::get()->filter(array('Title' => $tag, 'BlogID' => $this->ParentID)); if($existingTag->count()) { //if tag already exists we will simply add it to this post. $tagObject = $existingTag->First(); diff --git a/code/widgets/BlogArchiveWidget.php b/code/widgets/BlogArchiveWidget.php index 794c49a..9477f41 100644 --- a/code/widgets/BlogArchiveWidget.php +++ b/code/widgets/BlogArchiveWidget.php @@ -106,15 +106,17 @@ class BlogArchiveWidget extends Widget { /** * @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(