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

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

    In javascript:

    Handling recurring schedules: http://bunkat.github.io/later/

    Handling complex events and dependencies between those schedules: http://bunkat.github.io/schedule/

    Basically, you create the rules then you ask the lib to compute the next N recurring events (specifying a date range or not). The rules can be parsed / serialised for saving them into your model.

    If you have a recurring event and would like to modify only one recurrence you can use the except() function to dismiss a particular day and then add a new modified event for this entry.

    The lib supports very complex patterns, timezones and even croning events.

提交回复
热议问题