summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-03-31 07:43:13 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-03-31 07:43:37 (GMT)
commitf4531102a27fd76149caa88fc6cb878a3378e001 (patch)
treebab39055957a11cef23bb55c185ac60010f4bd10
parenta67881cd8cd88401e589eaa58402b20b7347df26 (diff)
downloadroundcubemail-plugins-kolab-f4531102a27fd76149caa88fc6cb878a3378e001.tar.gz
Fix loading of birthday events in December when range spans over two years (#4920)
-rw-r--r--plugins/calendar/drivers/calendar_driver.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/calendar/drivers/calendar_driver.php b/plugins/calendar/drivers/calendar_driver.php
index b25f1c5..3258666 100644
--- a/plugins/calendar/drivers/calendar_driver.php
+++ b/plugins/calendar/drivers/calendar_driver.php
@@ -693,18 +693,19 @@ abstract class calendar_driver
// quick-and-dirty recurrence computation: just replace the year
$bday->setDate($year, $bday->format('n'), $bday->format('j'));
$bday->setTime(12, 0, 0);
+ $this_year = $year;
// date range reaches over multiple years: use end year if not in range
if (($bday > $end || $bday < $start) && $year2 != $year) {
$bday->setDate($year2, $bday->format('n'), $bday->format('j'));
- $year = $year2;
+ $this_year = $year2;
}
// birthday is within requested range
if ($bday <= $end && $bday >= $start) {
- $age = $year - $birthyear;
+ $age = $this_year - $birthyear;
$event = array(
- 'id' => rcube_ldap::dn_encode('bday:' . $source . ':' . $contact['ID'] . ':' . $year),
+ 'id' => rcube_ldap::dn_encode('bday:' . $source . ':' . $contact['ID'] . ':' . $this_year),
'calendar' => self::BIRTHDAY_CALENDAR_ID,
'title' => $event_title,
'description' => $rcmail->gettext(array('name' => 'birthdayage', 'vars' => array('age' => $age)), 'calendar'),