Repeating "Events" (Calendar)

I am currently working on an application that allows people to schedule "Impressions" for an online radio station.

I want the user to be able to set up a repeat event, for example, for example: -

"Manic Monday" show - every Monday from 9-11 "Monthly average insanity" - every second Thursday of the month "This new music of the month" - on the 1st of every month.

Which, in your opinion, is the best way to model this (based on the MVC / MTV structure).

Note. I really code this in Django. But I'm more interested in the theory behind it, rather than the specific implementation details.

+6
date events calendar
source share
3 answers

And, recurring events - one of the bans of my life, as well as time zones. The calendar is difficult.

You might want to simulate this from the perspective of RFC2445 . However, this can give you much more flexibility and complexity than you really want.

A few things to consider:

  • Do you need finer granularity than a specific time on a given date? If you need to repeat in time, it becomes more difficult.
  • Consider angular cases such as “the 30th of every month” and what that means for leap years.
  • Consider temporary corner cases such as “1.30am every day” - sometimes 1.30am can happen twice, and sometimes it may not happen at all due to daylight saving time.
  • Need to share timetables with people in other time zones? It makes life more complicated.
  • Do you need to indicate the number of times the event occurs, or the end date of its occurrence? ("Count" or "until" basically.) You may not need it, or you may need one or both.

I understand that this is a list of things to think about a more than final answer, but I consider it important to determine the parameters of your problem before trying to work out a solution.

+9
source share

From reading other posts, Martin Fowler describes recurring events best. http://martinfowler.com/apsupp/recurring.pdf

Someone implemented these classes for Java. http://www.google.com/codesearch#vHK4YG0XgAs/src/java/org/chronicj/DateRange.java

+1
source share

I had the idea that recurring events should be generated while saving the original event with a new model. This means that I do not perform random processing every time the calendar is loaded (and I can also, for example, undo one “Show” in a series), but also means that I have to limit this to a certain time interval, so if someone he will say, a year later, they would not see these repeated shows. But at some point they should (potentially) be generated.

0
source share

All Articles