Fix TZOFFSET values with minutes (#3199)
This commit is contained in:
parent
f9b19b9f27
commit
1f27e238a8
2 changed files with 5 additions and 3 deletions
|
@ -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'];
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue