Notices


Reply
Thread Tools
Posts: 5 | Thanked: 6 times | Joined on Jul 2010
#1
Hi all, I'm new here, so apologies if this is in the wrong forum.

EDIT: solution in post below

What is the best way to set non-standard recurring events? For a real-world example, I have a tutorial for university, beginning next Tuesday and repeating fortnightly until the mid-semester break, which means creating the following appointment:
Tuesday 20th July, from 15:10--16:00
Repeat: fortnightly, until 27th August

After searching the these forums & the wider internet, it seems to come down to a few options:
*) Don't. Create a single appointment for every occurrence. This is slow, inefficient, and makes changing any detail a batch process.

*) As mentioned here: http://wiki.maemo.org/Repeating_entries_in_Calendar , export the repeating entry from a desktop calendar and import with the N900-calendar. I tried this with Evolution, and it didn't work- detail said `repeat weekly' but didn't repeat at all.

*) Using GPE Calendar, creating an event, then saving and importing to N900-calendar. This seems to work with all-day events, but not with timed appointments.

*) The solution by `kortsi': http://talk.maemo.org/showpost.php?p=496924&postcount=4 , editing the SQLite db by hand. This works, however it still says "Repeat:weekly" but displays fortnightly, so if you edit an appointment for any reason, it reverts back to weekly.
If I can flag an event as being a "Complex event. Unable to edit.", in theory this would allow you to edit the appointment without losing the modified-repeat. It's been a few years since I've done any SQL, but it seems most records in the RECURSIVE table have a last field of 3 or 5, eg
"620|FREQ=WEEKLY;UNTIL=20101015T105000!||||-1|3"
...but an event the N900-calendar flags as "Unable to edit" has a different value- one ended in "|6".


I'm going to go and read up on my old SQL notes and experiment, does anyone else have any other suggestions on how best to enter custom repeating events?

//G

Last edited by G..; 2010-07-15 at 15:46.
 
Posts: 5 | Thanked: 6 times | Joined on Jul 2010
#2
Hi guys, just a quick update, after refreshing my knowledge of SQL, I think I've figured it out, so I'm posting my current solution in case anyone else wants to know, or can give (constructive) feedback.


To create an n-daily, n-weekly, or n-monthly repeating event

First create an event in the calendar, and make it a repeating event. Close the calendar afterwards, and open an xterm.

Code:
cd ~/.calendar
cp calendardb calendardb.old
It's important to backup your old db in case you drop an entire table, update all records by mistake, or have tourettes and change everything to expletives.

Code:
sqlite3 calendardb
select * from components where summary="Exact event title";
First you need to find the id of the event you created in the calendar, using the exact event title. When you find it (returns a record instead of doing nothing), take note of the first field, eg "123".

Code:
select * from recursive where id=123;
Verify SQLite returns an entry. If it doesn't, then you haven't set the event to repeat, or used the wrong id. You could insert a record into the table manually, but it's a little more complex.

Code:
update recursive
set rrule="FREQ=WEEKLY;INTERVAL=2!",
rtype=6
where id=610;
You are now modifying the `recursive' table with a `complex' event, so incredibly complex you could probably figure it out by yourself. In this example, setting rrule to "FREQ=WEEKLY;INTERVAL=2!" means it repeats 2-weekly. DAILY, MONTHLY, YEARLY will do the same thing.
If you want an event to repeat fortnightly until a specific date, you can insert an "UNTIL=yyyymmddThhmmss", eg "UNTIL=20100101T140000", or more easily set the repeat detail in the calendar program, then copy that detail in SQLite. To be honest I'm not sure what the other details I've seen are (eg "WKST" and "BYDAY").
The `rtype' appears to be the 'repeat type', although I'm not sure why it can't deduce that from the rrule field. 1 is daily, 2 is every workday, 3 is weekly, 4 is monthly, 5 is yearly. By setting it to 6, you flag it as non-standard, and the calendar will say "Complex event. Unable to edit.". If you don't set it to >5, the calendar application will say the event is daily/weekly/monthly (but display as fortnightly/whatever), and editing any part of the event will revert back to standard behavior. By setting rtype to 6, you can modify any other detail of the event without affecting the repeat. In fact, the calendar will warn you "You are changing a repeat rule for event xxxx that is unable to be fully edited. Any exception rules will be lost. Continue?".
The final `where id=123;' means you want to update one record, not the entire table. Don't put a semicolon before this line, else you could update the entire recursive table as `complex events'. That's why we made a backup.

If it was successful, it should output nothing. Ctrl+D to close SQLite, and verify changes in the calendar.
 
Posts: 88 | Thanked: 28 times | Joined on Jul 2010 @ London
#3
Go to calender -> then new event -> then enter title, enter where, unclick all day -> change "From" to the date you want to start -> then change "To" to the date you want it to end -> click on repeat and then select "month" -> then click "until" and change the date to when you want to end it -> then set the alarm timing and then click "Done"

and then you are DONE !!! Wohoo

Orion 88
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:48.