plugins/calendar
Thomas Brüderli
bruederli at kolabsys.com
Tue Mar 31 09:43:38 CEST 2015
plugins/calendar/drivers/calendar_driver.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit f4531102a27fd76149caa88fc6cb878a3378e001
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date: Tue Mar 31 09:43:13 2015 +0200
Fix loading of birthday events in December when range spans over two years (#4920)
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'),
More information about the commits
mailing list