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

后端 未结 18 2532
感情败类
感情败类 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:33

    You store the events in iCalendar format directly, which allows for open-ended repetition, time-zone localisation and so forth.

    You could store these in a CalDAV server and then when you want to display the events you can use the option of the report defined in CalDAV to ask the server to do the expansion of the recurring events across the viewed period.

    Or you could store them in a database yourself and use some kind of iCalendar parsing library to do the expansion, without needing the PUT/GET/REPORT to talk to a backend CalDAV server. This is probably more work - I'm sure CalDAV servers hide complexity somewhere.

    Having the events in iCalendar format will probably make things simpler in the long run as people will always want them to be exported for putting in other software anyway.

提交回复
热议问题