Tuesday, 15 November 2016
  14 Replies
  3K Visits
0
Votes
Undo
Hi!

I've already searched through the forum but didn't find a solution.

My problem is that I've got an Office 365 ics link with the attribute set
TZID: (UTC+01:00) Amsterdam\, Berlin\, Bern\, Rom\, Stockholm\, Wien


when i try to add a new calendar saying it should take all the new appointments from the .ics link I have, I get the following error message:
DateTimeZone::__construct(): Unknown or bad timezone ((UTC+01)


so what can I do against this problem? Can I convert this .ics file or the attributes that are needed to GMT timezone?

Thanks in regards!

best wishes
8 years ago
·
#178764
0
Votes
Undo
Hello,

That's not a standard timezone format so you will need to add it in to JEvents file:

components/com_jevents/libraries/iCalImport.php

See for example:

You would add for example:

$wtzdata["(UTC+01"] = "Europe/Amsterdam";
$wtzdata["(UTC+01:00) Amsterdam\, Berlin\, Bern\, Rom\, Stockholm\, Wien"] = "Europe/Amsterdam";

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!Join the JEvents club today!

0
Votes
Undo
Hi, thanks for the fast respond!

I tried the following in this file which didn't work:


/////////////////// SELF ADDED BEGIN ///////////////////
$wtzdata["(UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien"] = "Europe/Amsterdam";
$wtzdata["Amsterdam\, Berlin\, Bern\, Rom\, Stockholm\, Wien"] = "Europe/Amsterdam";
$wtzdata["Amsterdam, Berlin, Bern, Rom, Stockholm, Wien"] = "Europe/Amsterdam";
$wtzdata["UTC+01:00 Amsterdam\, Berlin\, Bern\, Rom\, Stockholm\, Wien"] = "Europe/Amsterdam";
$wtzdata["UTC+01:00 Amsterdam, Berlin, Bern, Rom, Stockholm, Wien"] = "Europe/Amsterdam";
$wtzdata["(UTC+01:00)"] = "Europe/Amsterdam";
$wtzdata["UTC+01:00"] = "Europe/Amsterdam";
/////////////////// SELF ADDED END ///////////////////


Your solution with the

$wtzdata["(UTC+01"] = "Europe/Amsterdam";
works now. Thanks...

but.... now i get new error...:

DateTime::__construct(): Failed to parse time string (00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien"20161014T190000) at position 0 (0): Unexpected character


that's how the ics looks like (part from it):

BEGIN:VEVENT
DESCRIPTION:some description
UID:some UID
SUMMARY:some summary
DTSTART;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien":2016
1014T190000
DTEND;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien":201610
14T210000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20161115T104921Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION:some location
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT


any ideas? :)
8 years ago
·
#178773
0
Votes
Undo
the : is a special character in the iCal format so I'm VERY surprised at Microsoft allowing it in a timezone id.

change line 2234 of components/com_jevents/libraries/iCalImport.php from

$matches = explode(":",$vcLine,2);

to
				$matches = explode(":",$vcLine,3);                                
// Catch some bad Microsoft timezones e.g. "(UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien"
if (count($matches) == 3) {
$matches[0] = $matches[0].":".$matches[1];
$matches[1] = $matches[2];
unset($matches[2]);
}


and it should resolve the issue

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!

0
Votes
Undo
Well, thank you really for your help!!

Now I get no error in the backed.
Sadly Every appointment gets imported on every single day, see attachment....

Before I posted my question into this forum, I tried with the search & replace funktion to replace all this UTC crap with 'GMT Standard Time' and created a calendar with uploading the ics file from my computer. This solution worked fine. Every appointment was on its day - obviously with the wrong time....

I hope I don't waste your time helping me....
8 years ago
·
#178777
0
Votes
Undo
Can you provide a full copy of your iCal file?

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!Join the JEvents club today!

0
Votes
Undo
I'll send you a priv. message :-)
8 years ago
·
#178781
0
Votes
Undo
Please adjust Geraints replacement code to:


$matches = explode(":",$vcLine,3);
// Catch some bad Microsoft timezones e.g. "(UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien"
if (count($matches) == 3) {
$matches[0] = $matches[0];
$matches[1] = $matches[2];
unset($matches[2]);
}


And run again.

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!Join the JEvents club today!

0
Votes
Undo
Now it works like it should!

Thank you very much!! :-)

So for the next update I'll have to add/replace the code again, right?
8 years ago
·
#178792
0
Votes
Undo
Yep I'm afraid so!

Many thanks
Tony

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!Join the JEvents club today!

8 years ago
·
#178798
0
Votes
Undo
No - I'll actually include it in the next release since it won't harm anyone else.

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!

0
Votes
Undo
Okay, thank you very much! :-)
8 years ago
·
#178833
0
Votes
Undo
p.s. Remember to add your custom timezone in the file components/com_jevents/libraries/ical_custom_timezones.php as

<?php
$wtzdata["UTC+01:00 Amsterdam, Berlin, Bern, Rom, Stockholm, Wien"] = "Europe/Amsterdam";

JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!

  • Page :
  • 1
There are no replies made for this post yet.