Topic: Dates to humanized sentences ?


I have an Event model, and an Occurrence model, that expresses when an event takes place in time.

The event "Harry Potter, The Musical" will have 9 occurrences :

2007-08-02 18:00
2007-08-02 20:00
2007-08-02 22:00

2007-08-03 18:00
2007-08-03 20:00
2007-08-03 22:00

2007-08-04 18:00
2007-08-04 20:00
2007-08-04 22:00

I would like to have an automated way to express that as :
"from the 2nd to the 4th of August, at 6pm, 8pm and 10pm".

Any idea where to start? I had a look at the Chronic gem, that does the opposite (parses strings into dates), but it hasn't been of much help. Any ideas?

Last edited by auguste (2007-07-18 04:47:20)

Re: Dates to humanized sentences ?

Re: Dates to humanized sentences ?

You might want to read the end of my post smile

Re: Dates to humanized sentences ?

I am also interested in this, could come in handy later.

I think you would find the first date, and then see if it has a show on the next date and so on until the day after doesn't have a show. Then you could make it say what you want it to say.