On 07 Jul 2011, at 16:57, Andrew wrote:
I believe you’re looking for temporal expressions.
I believe that I am, too. I came across Runt and that lead me to the
article written by Martin F. about Temporal Expressions.
Would be nice if you could include my original message the next time,
it’s easier for me to remember what I posted instead of having to
search my mail for the original reply
Definitely a step in the right direction. However, I still can’t wrap
my mind around how to create a form that I can use to create these
It all depends on the complexity of your recurring events really. I’d
suggest starting off by building a form that incorporates the schedule
parameters you want to convert into a Runt expression. You could use
something like what Google C. does, which is pretty basic, or
you can go full out complex with multiple combined expressions etc.
Your biggest challenge after that will be to convert the parameters
that come into your controller into a Runt expression. I’d suggest
writing a dedicated class for that, something like
# code goes here
Runt has some nice docs on how to create expressions at
Not much I can do to help you here, you’ll just need to bite the
bullet and write something that works for you based on what the docs
then how to convert the temporal expressions
into a schedule layout.
Once you have your expression, you can ask it to give you all the
dates in a certain range that comply with your expression:
mon_wed_fri = DIWeek.new(Mon) | DIWeek.new(Wed) | DIWeek.new(Fri)
It’ll be up to you to determine how you want to display that schedule
to the user of course. You can generate some kind of calendar like has
been suggested or keep it plain and simple with a list. It all depends
on your application I guess.
Peter De Berdt