日历重复/重复事件 - 最佳存储方法 - 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
「其他文章」