From 9ed3fae364bbe57028eaa4b1e946bf6c1d01d146 Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Mon, 18 Feb 2013 09:44:30 +0200 Subject: [PATCH] Use a fixed string to specify tag format --- 3.0/modules/date_tag/helpers/date_tag.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/3.0/modules/date_tag/helpers/date_tag.php b/3.0/modules/date_tag/helpers/date_tag.php index 424cdf15..87023fff 100644 --- a/3.0/modules/date_tag/helpers/date_tag.php +++ b/3.0/modules/date_tag/helpers/date_tag.php @@ -21,8 +21,13 @@ class date_tag { static function tag_item($item) { if ($item->is_photo() && $item->captured) { - tag::add($item, date("F", $item->captured)); - tag::add($item, date("Y", $item->captured)); + $date_format = "F, Y"; + foreach (explode(",", date($date_format, $item->captured)) as $tag_name) { + $tag_name = trim($tag_name); + if ($tag_name) { + tag::add($item, $tag_name); + } + } } return; }