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()>
<cfset results = ical.getEvents()>
The download is in the My Tools pod.
Archived Comments
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
Updated.
OK... quick question. How do we create an iCal file to start with?
You can get one from Mozilla Sunbird. That's where I got mine.
Ray, how hard would it be for you (or me for that matter) to add code that writes the ICS file from a CFQUERY?
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.
Where is the 'My Tools' pod?
Try the Projects tab.
Has the iCal CFC been retired? I can't seem to find it under Projects.
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...
Hey Ray, did you ever update the cfc so that it creates ical files?
Unfortunately no. Sorry.
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#">
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"; }
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!
Hi Raymond,
Where can I find the source code of iCal CFC Part 2?
This link is dead: http://www.coldfusionjedi.c...
Thanks,
Riaan
Try www.raymondcamden.com/enclo....
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...
Charlie you are absolutely right. Thanks.