From b579a2f7f5f6d3a2e3dd055acb2a5b5e722843d8 Mon Sep 17 00:00:00 2001 From: borisneubert <> Date: Sun, 31 Aug 2014 16:56:38 +0000 Subject: [PATCH] applied immi's TZ patch http://forum.fhem.de/index.php/topic,26034.msg194038.html#msg194038 git-svn-id: https://svn.fhem.de/fhem/trunk@6491 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/57_Calendar.pm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/57_Calendar.pm b/fhem/FHEM/57_Calendar.pm index 259a036d0..c70b32eaf 100644 --- a/fhem/FHEM/57_Calendar.pm +++ b/fhem/FHEM/57_Calendar.pm @@ -67,7 +67,16 @@ sub addproperty { my ($self,$line)= @_; # TRIGGER;VALUE=DATE-TIME:20120531T150000Z #main::Debug "line= $line"; - my ($property,$parameter)= split(":", $line,2); # TRIGGER;VALUE=DATE-TIME 20120531T150000Z + my ($property,$property1,$parameter); + ####### takes care of TZID, which has ":" in the property DTEND;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna":20140904T180000 + if ($line =~ m/TZID=/){ + ($property,$property1,$parameter)= split(":", $line,3); + $property .=$property1; + } + else { + ($property,$parameter)= split(":", $line,2); + } + ###### #main::Debug "property= $property parameter= $parameter"; my ($key,$parts)= split(";", $property,2); #main::Debug "key= $key parts= $parts"; @@ -109,6 +118,15 @@ sub parseSub { #main::Debug "$ln: $line"; $ln++; next if($line eq ""); # remove empty line + #### corrects line-wraps: if next line is starting with at least 2 spaces, join them + if ($ln<$#ical){ + my $line1= $ical[$ln]; + if ($line1 =~ s/^\s\s*//) { + $line.=$line1; + $ln++; + }; + }; + #### last if($line =~ m/^END:.*$/); if($line =~ m/^BEGIN:(.*)$/) { my $entry= ICal::Entry->new($1);