日曆重複/重複事件 - 最佳存儲方法 - Calendar Recurring/Repeating Events - Best Storage Method

語言: CN / TW / HK

問題:

I am building a custom events system, and if you have a repeating event that looks like this:我正在構建一個自定義事件系統,如果您有一個如下所示的重複事件:

Event A repeats every 4 days starting on March 3, 2011事件 A 從 2011 年 3 月 3 日開始每 4 天重複一次

or或者

Event B repeats every 2 weeks on Tuesday starting on March 1, 2011事件 B 從 2011 年 3 月 1 日開始,每兩週重複一次

How can I store that in a Database in a way that would make it simple to lookup.如何以一種易於查找的方式將其存儲在數據庫中。 I don't want performance issues if there are a large number of events, and I have to go through each and every one when rendering the calendar.如果有大量事件,我不希望出現性能問題,並且在渲染日曆時我必須逐一檢查。


解決方案:

參考一: http://stackoom.com/question/LkUw
參考二: Calendar Recurring/Repeating Events - Best Storage Method
「其他文章」