iCal CFC Part 2

After some common-sense advice from Sean, I've upgraded the iCal CFC. It now uses an init method to load in the original string. It also caches the parsed events in case you need to run it again.

As an example:

<cfset ical = createObject("component","ical").init(data)>
<cfset results = ical.getEvents()>

The download is in the My Tools pod.

Archived Comments

Comment 1 by tony petruzzi posted on 5/26/2005 at 1:15 AM

get an error when trying to run the test file for ical. It can't find the christianholidays.ics file. The file isn't included in the zip download. Any chance of getting this so I can look at it?

- Tony

Comment 2 by Raymond Camden posted on 5/26/2005 at 1:49 AM

Updated.

Comment 3 by John Farrar posted on 10/4/2005 at 1:05 AM

OK... quick question. How do we create an iCal file to start with?

Comment 4 by Raymond Camden posted on 10/4/2005 at 1:19 AM

You can get one from Mozilla Sunbird. That's where I got mine.

Comment 5 by C. Lee Smith posted on 10/27/2005 at 12:51 AM

Ray, how hard would it be for you (or me for that matter) to add code that writes the ICS file from a CFQUERY?

Comment 6 by Raymond Camden posted on 10/27/2005 at 3:26 PM

Not quite sure what you mean. The point of the CFC is ot parse an ICS string, not to _make_ ICS strings, although I could update it to of course.

Comment 7 by Joost van der Drift posted on 9/14/2007 at 7:12 PM

Where is the 'My Tools' pod?

Comment 8 by Raymond Camden posted on 9/14/2007 at 7:16 PM

Try the Projects tab.

Comment 9 by Christopher Jewell posted on 10/12/2007 at 11:09 PM

Has the iCal CFC been retired? I can't seem to find it under Projects.

Comment 10 by Raymond Camden posted on 10/23/2007 at 7:33 PM

Not sure if it is "retired", but I haven't worked on it in a long time. You can find it here:

http://www.coldfusionjedi.c...

Comment 11 by Nak1 posted on 2/14/2008 at 7:02 AM

Hey Ray, did you ever update the cfc so that it creates ical files?

Comment 12 by Raymond Camden posted on 2/14/2008 at 7:12 PM

Unfortunately no. Sorry.

Comment 13 by Dave posted on 2/22/2008 at 9:53 PM

First off, I'm not exactly an expert when it comes to Coldfusion yet I did wanted share a 'work around' that I've been forced to use. I'm not sure how helpful this is... or perhaps it's just a dumb way to code but, the problem is that I have to store my .ics file on a different web hosting environment. The following seems to work. I replaced:

<cfset theFile = expandPath("./calendar.ics")>
<cffile action="read" file="#theFile#" variable="data">

with:

<cfhttp url="http://www.myotherdomain.ca..." method="get">
<cfset data = "#CFHTTP.FileContent#">

Comment 14 by arcster posted on 9/25/2009 at 12:29 AM

I echo Dave's comment about the need for cfhttp on remote files. Also I found some timestamps have "0Z" or "6Z" as the final characters, which caused an error. I added the following to ical.cfc after line 151: if(find("Z",second)) {second = "00"; }

Comment 15 by arcster posted on 9/25/2009 at 11:38 PM

Elsewhere on this site (http://www.coldfusionjedi.c... I found a tip on how to sort a structure within an array. I adapted that code and added it just before the end of the GetEvents function and voila, now the dates are sorted!

Comment 16 by Riaan posted on 4/22/2014 at 1:09 PM

Hi Raymond,

Where can I find the source code of iCal CFC Part 2?
This link is dead: http://www.coldfusionjedi.c...

Thanks,

Riaan

Comment 17 by Raymond Camden posted on 4/22/2014 at 5:52 PM
Comment 18 by Charlie Arehart posted on 11/21/2014 at 5:49 AM

About the last comment below from Ray (in the old form of comments here), somehow the URL he offered (pointing to where to find his zip file) ended up doubling his domain name when you clicked the link. Perhaps the comment software saw his URL as not having a domain so treated it as relative.

The corrected URL is http://www.raymondcamden.co...

Comment 19 by Raymond Camden posted on 11/21/2014 at 11:19 AM

Charlie you are absolutely right. Thanks.