To import an .ics, follow this link and read Uncle Cheese's post about ICS Feeds.
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
- Previous 10 entries
- 1
- Page 22(current)
I've had the same problem with timezones when importing a google ics. I tried coffeymachine's function which worked to some extent but meant that times were always shown even if the event was a full or multi-day event so I decided to write my own little hack by reformatting the original string.
I also came across a second issue. Google marks a full day event by an end date of the next day which in effect was causing my dates to show a day extra.
+ checks to see if the date is full/multiday and adjusts the end time by one day.
+ adds ability to offset timezone for events with times associated.
In event_calendar/code/CalendarUtil.php line 153 add the extra code to the function date_info_from_ics:
public static function date_info_from_ics($dtstart, $dtend)
{
$start_date = null;
$end_date = null;
$start_time = null;
$end_time = null;
/* Google Calendar ICS date hacks for timezone settings and full day events */
$fulldaytest = explode("T",$dtstart);
if(!isset($fulldaytest[1]))
$dtend = date('Ymd', strtotime($dtend.'-24 hours'));
else {
$myOffset = '+9 hours'; // manual offset for Korea
$startTimestamp = strtotime($dtstart.$myOffset);
$dtstart = date('Ymd', $startTimestamp)."T".date('His', $startTimestamp)."Z";
$endTimestamp = strtotime($dtend.$myOffset);
$dtend = date('Ymd', $endTimestamp)."T".date('His', $endTimestamp)."Z";
}
/* END Google ICS hack */
..... rest is the same as original function
}
Not too pretty but it'll do the job for now and I have not tested this thoroughly - so use at your own risk.
Hope this helps anyone else out there or at least puts you on the right track.
Regards,
Jared
Can't import any kind of ics into the calendar... It causes the page to go to error 500.
- Previous 10 entries
- 1
- Page 22(current)