summaryrefslogtreecommitdiff
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:00:13 (GMT)
commit412bee468a6a4432edce47cafd07a8b64562666e (patch)
tree90eb93332c9af52297ac720afa0462c58f1452e1
parent49695c7d69433cedd242ccd8fa8baf498dfffee2 (diff)
downloadroundcubemail-plugins-kolab-412bee468a6a4432edce47cafd07a8b64562666e.tar.gz
Fix TZOFFSET values with minutes (#3199)
-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 2a39aac..bb43388 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -1191,8 +1191,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 a670d0c..4ea9ede 100644
--- a/plugins/libcalendaring/tests/libvcalendar.php
+++ b/plugins/libcalendaring/tests/libvcalendar.php
@@ -519,8 +519,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)