What's the best way to model recurring events in a calendar application?

后端 未结 18 2539
感情败类
感情败类 2020-11-27 08:54

I\'m building a group calendar application that needs to support recurring events, but all the solutions I\'ve come up with to handle these events seem like a hack. I can li

18条回答
  •  醉话见心
    2020-11-27 09:15

    Store the events as repeating and dynamically display them, however allow the recurring event to contain a list of specific events that could override the default information on a specific day.

    When you query the recurring event it can check for a specific override for that day.

    If a user makes changes, then you can ask if he wants to update for all instances (default details) or just that day (make a new specific event and add it to the list).

    If a user asks to delete all recurrences of this event you also have the list of specifics to hand and can remove them easily.

    The only problematic case would be if the user wants to update this event and all future events. In which case you'll have to split the recurring event into two. At this point you may want to consider linking recurring events in some way so you can delete them all.

提交回复
热议问题