设计Google日历等日历系统 [英] Designing a Calendar system like Google Calendar

查看:235
本文介绍了设计Google日历等日历系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须创建类似于Google日历的东西,所以我创建了一个包含用户所有事件的事件表。



事件表中的行有一个event_type字段,它告诉你什么样的事件,因为一个事件只能是一个单一的日期,或者每x天重新发生一次事件。



主要设计挑战是处理重新发生的事件。



当用户查看日历时,使用该月份的观点,如何显示给定月份的所有活动?这个查询会很棘手,所以我觉得创建另一个表格并为每一个事件创建一个行,比如重新发生事件会更容易。



解决方案

如前所述, 不要重新发明轮子

em> ,只是增强它。



结帐 VCalendar ,它是开放源代码,并进入PHP,ASP和ASP.Net(C#)!



另外你可以查看 Day Pilot ,它提供了一个以Asp.Net 2.0编写的日历。他们提供了一个您可以查看的精简版本,如果它适用于您,您可以购买许可证。



更新(9/30/09) :



除非轮子坏了!另外,如果你喜欢,你可以放一个闪亮的新的油漆(即:做一个更好的UI)。但至少尝试找到一些基础,因为日历系统可能很棘手(与重复事件),已经完成了数千次。


I have to create something similiar to Google Calendar, so I created an events table that contains all the events for a user.

The hard part is handling re-occurring events, the row in the events table has an event_type field that tells you what kind of event it is, since an event can be for a single date only, OR a re-occuring event every x days.

The main design challenge is handling re-occurring events.

When a user views the calendar, using the month's view, how can I display all the events for the given month? The query is going to be tricky, so I thought it would be easier to create another table and create a row for each and every event, including the re-occuring events.

What do you guys think?

解决方案

As previously stated, don't reinvent the wheel, just enhance it.

Checkout VCalendar, it is open source, and comes in PHP, ASP, and ASP.Net (C#)!

Also you could check out Day Pilot which offers a calendar written in Asp.Net 2.0. They offer a lite version that you could check out, and if it works for you, you could purchase a license.

Update (9/30/09):

Unless of course the wheel is broken! Also, you can put a shiny new coat of paint if you like (ie: make a better UI). But at least try to find some foundation to build off of, since the calendar system can be tricky (with Repeating events), and it's been done thousands of times.

这篇关于设计Google日历等日历系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆