Hi,
This is not the point, just a little background:
I'm in the process of developing a small app that will produce a calendar.
What I would love to do is to create an easy way for users to add events that will rerturn like: yearly, every first monday of the month, every week, every three weeks, every 3 months except if it's on a sunday, etc.
And (here comes the point!) I would love to make it so that it's just editing a text-file. Like some kind of regex for dates that humans and computers can read almost as easily (leaning towards humans, in contrast to regexs).
Anyone got any ideas?
I've got some kind of feeling that the date-format constants used for date(format, timestamp) could be useful in some way.
What I'm aiming at is something like:
yearly(24/12): fill up chimney with broken glass
monthly(monday(1):17.15): call probation officer
daily(21.00): go to bed as to preserve some kind of sense of humor
/tsr
designing a usable notation for returning events
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
yes, but...
...what I'm interrested in at the moment is how to the notation should look like.
I'm aiming at some kind of notation that could represent a recurring event how-ever (or at least almost) it would be represented in a natural language.
The parsing of it is a later question.
I'm aiming at some kind of notation that could represent a recurring event how-ever (or at least almost) it would be represented in a natural language.
The parsing of it is a later question.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
feyd: good idea, I'll look into that. (Nope, sorry, it doesn't seem to quite meet my req of being able to say 'the first saturday of every month, except july and dec')
arborint: thanks, do you have any more info for me on this, so that I don't need to evaluate some 50+ projects (searching for "calendar to-do" in PHP on freashmeat actually got me 84 projects)
Ah, well I'll maybe just dig into iCal more...
/tsr
arborint: thanks, do you have any more info for me on this, so that I don't need to evaluate some 50+ projects (searching for "calendar to-do" in PHP on freashmeat actually got me 84 projects)
Ah, well I'll maybe just dig into iCal more...
/tsr
With a little wrapper it's relatively easy to achieve though...tsr wrote:feyd: good idea, I'll look into that. (Nope, sorry, it doesn't seem to quite meet my req of being able to say 'the first saturday of every month, except july and dec')
Eg, run on the first seven days of the month at 9am, check if it's saturday, and then do your thing...
0 9 1-7 * * run-on-dow Sat echo "Wake up! xxx needs a yyy!"
Where run-on-dow is something like:
Code: Select all
#!/bin/bash
if [ `date +%a` = $1 ]; then
shift
exec "$@"
fi