Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can javascript parse an ical calender file directly? 1

Status
Not open for further replies.
Joined
Apr 18, 2006
Messages
1
Location
US
I am trying to find a way to parse event lists in the ical /vcalendar format into a much simpler event array in javascript. (I throw away much of the calendar information, keeping only the date and the summary.)

If I first open the ical file and add a var cal=" to the beginning, a " to the end and either remove all line endings or add a \ at the end of each, I can do it. The resulting file is then treated as an ordinary external .js file and cal is simply a string that can be parsed for the data I want to be part of the javascript event array.

What I'd like to be able to do is to take the raw ical file and have it read as either an array or a string without the initial editing in of the var cal=" \" stuff.

1) Is it possible?
2) If so how?


Thanks Brickoleur.
ps. If anyone knows why Sunbird moved away from ical and went to a simplified sql for its internal handling of calenders, I'd love to know...
 
Reading from text files is possible in IE using a proprietary ActiceX control, which doesn't work in any other browser, and possibly in Firefox/other browser using some sort of Java IO routines (although I don't know much about this).

Your best best is to keep editing the files, or parse them out server-side to deliver the correct "JS" files to the client.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top