Skip to content

Commit

Permalink
[jan] Make BYMONTHDAY property as short as possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Oct 18, 2013
1 parent 24f13b8 commit 003fc41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions framework/Timezone/lib/Horde/Timezone/Rule.php
Expand Up @@ -198,15 +198,15 @@ public function addRules(Horde_Icalendar_Vtimezone $tz, $tzid, $name,
$last->setTimezone('UTC');
$until = ';UNTIL=' . $last->format('Ymd\THIs') . 'Z';
}
for ($days = array(), $i = $day, $last = Horde_Date_Utils::daysInMonth($month, $rule[2]);
$i <= $last;
for ($days = array(), $i = $day, $lastDay = min(Horde_Date_Utils::daysInMonth($month, $rule[2]), $i + 6);
$day > 1 && $i <= $lastDay;
$i++) {
$days[] = $i;
}
$component->setAttribute(
'RRULE',
'FREQ=YEARLY;BYMONTH=' . $month
. ';BYMONTHDAY=' . implode(',', $days)
. ($days ? (';BYMONTHDAY=' . implode(',', $days)) : '')
. ';BYDAY=1' . Horde_String::upper(substr($weekday, 0, 2))
. $until);
} elseif (strpos($rule[6], '<=')) {
Expand Down
2 changes: 2 additions & 0 deletions framework/Timezone/package.xml
Expand Up @@ -22,6 +22,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [jan] Make BYMONTHDAY property as short as possible.
* [jan] Fix missing time of day in DTSTART and UNTIL properties.
* [jan] Don&apos;t create transitions that overlap.
* [jan] Use orginally requested time zone instead of alias in TZID.
Expand Down Expand Up @@ -198,6 +199,7 @@
<date>2013-05-06</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [jan] Make BYMONTHDAY property as short as possible.
* [jan] Fix missing time of day in DTSTART and UNTIL properties.
* [jan] Don&apos;t create transitions that overlap.
* [jan] Use orginally requested time zone instead of alias in TZID.
Expand Down

0 comments on commit 003fc41

Please sign in to comment.