summaryrefslogtreecommitdiff
path: root/plugins/libcalendaring
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-09-22 10:00:13 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-09-22 10:01:04 (GMT)
commit1f27e238a82761a9ac6897b56b58d98d85637d2e (patch)
treeb8af422b9dd97bec6d0c706003076c2833b6b9f4 /plugins/libcalendaring
parentf9b19b9f279178257a1a98511be5ecd360cede01 (diff)
downloadroundcubemail-plugins-kolab-1f27e238a82761a9ac6897b56b58d98d85637d2e.tar.gz
Fix TZOFFSET values with minutes (#3199)
Diffstat (limited to 'plugins/libcalendaring')
-rw-r--r--plugins/libcalendaring/libvcalendar.php4
-rw-r--r--plugins/libcalendaring/tests/libvcalendar.php4
2 files changed, 5 insertions, 3 deletions
diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index 939cc76..bdf8dea 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -1214,8 +1214,8 @@ class libvcalendar implements Iterator
$offset = $trans['offset'] / 3600;
$cmp->DTSTART = $dt->format('Ymd\THis');
- $cmp->TZOFFSETFROM = sprintf('%s%02d%02d', $tzfrom >= 0 ? '+' : '', floor($tzfrom), 0);
- $cmp->TZOFFSETTO = sprintf('%s%02d%02d', $offset >= 0 ? '+' : '', floor($offset), 0);
+ $cmp->TZOFFSETFROM = sprintf('%s%02d%02d', $tzfrom >= 0 ? '+' : '', floor($tzfrom), ($tzfrom - floor($tzfrom)) * 60);
+ $cmp->TZOFFSETTO = sprintf('%s%02d%02d', $offset >= 0 ? '+' : '', floor($offset), ($offset - floor($offset)) * 60);
if (!empty($trans['abbr'])) {
$cmp->TZNAME = $trans['abbr'];
diff --git a/plugins/libcalendaring/tests/libvcalendar.php b/plugins/libcalendaring/tests/libvcalendar.php
index d3a0ffe..ce4edea 100644
--- a/plugins/libcalendaring/tests/libvcalendar.php
+++ b/plugins/libcalendaring/tests/libvcalendar.php
@@ -523,8 +523,10 @@ class libvcalendar_test extends PHPUnit_Framework_TestCase
$this->assertEquals(false, $vtz);
// DateTimezone as input data
- $vtz = libvcalendar::get_vtimezone(new DateTimezone('Europe/Istanbul'));
+ $vtz = libvcalendar::get_vtimezone(new DateTimezone('Pacific/Chatham'));
$this->assertInstanceOf('\Sabre\VObject\Component', $vtz);
+ $this->assertContains('TZOFFSETFROM:+1245', $vtz->serialize());
+ $this->assertContains('TZOFFSETTO:+1345', $vtz->serialize());
}
function get_attachment_data($id, $event)