summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/libcalendaring/libcalendaring.php13
-rw-r--r--plugins/libcalendaring/libvcalendar.php2
2 files changed, 10 insertions, 5 deletions
diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php
index 698fb68..4f277cf 100644
--- a/plugins/libcalendaring/libcalendaring.php
+++ b/plugins/libcalendaring/libcalendaring.php
@@ -1501,7 +1501,7 @@ class libcalendaring extends rcube_plugin
/**
* Convert the internal structured data into a vcalendar rrule 2.0 string
*/
- public static function to_rrule($recurrence)
+ public static function to_rrule($recurrence, $allday = false)
{
if (is_string($recurrence))
return $recurrence;
@@ -1513,9 +1513,14 @@ class libcalendaring extends rcube_plugin
case 'UNTIL':
// convert to UTC according to RFC 5545
if (is_a($val, 'DateTime')) {
- $until = clone $val;
- $until->setTimezone(new DateTimeZone('UTC'));
- $val = $until->format('Ymd\THis\Z');
+ if (!$allday && !$val->_dateonly) {
+ $until = clone $val;
+ $until->setTimezone(new DateTimeZone('UTC'));
+ $val = $until->format('Ymd\THis\Z');
+ }
+ else {
+ $val = $val->format('Ymd');
+ }
}
break;
case 'RDATE':
diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index 195f99d..62ce19f 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -993,7 +993,7 @@ class libvcalendar implements Iterator
}
if ($event['recurrence']['FREQ']) {
- $ve->add('RRULE', libcalendaring::to_rrule($event['recurrence']));
+ $ve->add('RRULE', libcalendaring::to_rrule($event['recurrence'], (bool)$event['allday']));
}
// add EXDATEs each one per line (for Thunderbird Lightning)