Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


Anyone done any iCalendar work?

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

Gazdaman
I did a trackday!!!



Joined: 12 Aug 2004
Karma :

PostPosted: 23:08 - 15 Nov 2009    Post subject: Anyone done any iCalendar work? Reply with quote

I know this may out-geek what is essentially a motorbike forum! But I thought I'd try anyway.

I'm trying to write a .ics file to enter entries into a calendar every 10 days.

That's not too bad, it looks like this:

Code:

BEGIN:VCALENDAR
CALSCALE:GREGORIAN
METHOD:PUBLISH
VERSION:1.0
PRODID:-//GazScript//ShiftCal//EN
X-WR-CALNAME;VALUE=TEXT:ShiftCal

BEGIN:VEVENT
SUMMARY:First Early Shift
DTSTAMP:20091115T220000
UID:D70C88D5-E5A1-48EC-84A4-D05DBD5CD8F6-1
DTSTART:20091117T070000
DTEND:20091117T160000
RRULE:FREQ=DAILY;INTERVAL=10
BEGIN:VALARM
TRIGGER:-PT1H15M
REPEAT:1
DURATION:PT5M
ACTION:AUDIO
END:VALARM
END:VEVENT


END:VCALENDAR


The bit I can't work out, is how can I change the entry if it falls on a Thursday, Friday or Saturday. At the moment it just places an entry every 10 days regardless.

There is a BYDAY argument that allows you to specify a day, but I don't think it works if you've specified a 'DAILY' repeat rule.

Clutching at straws I know, but anyone done any?

Gaz
 Back to top
View user's profile Send private message Send e-mail Visit poster's website You must be logged in to rate posts

Neorion
World Chat Champion



Joined: 08 Jul 2008
Karma :

PostPosted: 09:29 - 16 Nov 2009    Post subject: Reply with quote

I dont do a lot of scripting but could you not use a conditional variable if thats supported in the code your using?

If var= thursday; friday; saturday'

Then

run whatyouwanttodo.script

Question
____________________
VFR FI 2000- Shiney Red Thing
"some things man was never meant to know, for everything else there's Google"
 Back to top
View user's profile Send private message You must be logged in to rate posts

Gazdaman
I did a trackday!!!



Joined: 12 Aug 2004
Karma :

PostPosted: 11:08 - 16 Nov 2009    Post subject: Reply with quote

I would, if one one existed in this particular language. Good thought anyway.

Gaz
 Back to top
View user's profile Send private message Send e-mail Visit poster's website You must be logged in to rate posts

dibbster
Nearly there...



Joined: 15 Apr 2004
Karma :

PostPosted: 14:52 - 16 Nov 2009    Post subject: Reply with quote

If it is every 10 days they will always fall in the same order e.g. If your 1st day is today (monday)

10 days would be Thu, then Sun Wed Sat Tue Fri and back to monday. Can you exploit that in some way?

What if you did it every 70 days and had 7 VEVENTS? (4 of one type and 3 different ones for Thur, Fri and Sat.)

Confused Just a thought Razz
____________________
Suzuki RF 600 - The two wheeled Testarossa (Deceased)
Suzuki GSXR - Now stops on a sixpence; SBK3's Thumbs Up
www.bikepics.com/members/dibbster
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Gazdaman
I did a trackday!!!



Joined: 12 Aug 2004
Karma :

PostPosted: 15:02 - 16 Nov 2009    Post subject: Reply with quote

Hmm, I like the way you think.

The scripting interface seems fairly crappy for the .ics file type. But if I used some other sort of scripting language I could work it out.

Basically eventually I want to write this into an iPhone app.
But with iPhones not being able to have things running in the background it's fairly useless. Hence I'm just trying to write them all into the calendar automagically.

I've done it at the moment with the first script, and I'm just editing thurs/fri/sats manually.

It's a start.

Gaz
 Back to top
View user's profile Send private message Send e-mail Visit poster's website You must be logged in to rate posts
Old Thread Alert!

The last post was made 16 years, 345 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.06 Sec - Server Load: 1.28 - MySQL Queries: 14 - Page Size: 46.36 Kb