Best way to develop/manage/design recurring tasks/calendar

后端 未结 4 1345
执笔经年
执笔经年 2021-02-03 14:27

An example of what I\'m talking about is similar to Google Calendar. When a new recurring task is created.

After creating the recurring task \"template\" - which all of

4条回答
  •  臣服心动
    2021-02-03 14:56

    For recurring events I did the following a while back:

    1. When a user entered an event I stored the event's date pattern GNU date style - the keyword for PHP is relative date formats.

    2. Then I started off by creating events for e.g. the next year. And created actual records where I converted the relative date to an actual -- e.g. "every first Monday" to a "mm-dd-YYYY". This allowed me to display them and also allow the user to e.g. move a single event or cancel one, etc..

    3. Then figure out how far to go into the future - my idea was to create events when the actual pages were browsed. E.g. if I had created events through June 2011 and someone skipped all the way to July 2011, I would iterate on my events and set them up transparently.

    4. When the user changes the relative pattern, offer to update all following events -- unless they have a custom pattern already. Relative patterns make it super easy to calculate all that.

提交回复
热议问题