设计像谷歌日历这样的日历系统 [英] Designing a Calendar system like Google Calendar

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

问题描述

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

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

困难的部分是处理重复发生的事件,事件表中的行有一个 event_type 字段,它告诉您它是什么类型的事件,因为一个事件只能针对一个日期,或者一个重复发生的事件每 x 天.

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.

主要的设计挑战是处理重复发生的事件.

当用户使用月份视图查看日历时,如何显示给定月份的所有事件?查询会很棘手,所以我认为创建另一个表并为每个事件创建一行会更容易,包括重新发生的事件.

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.

你们觉得呢?

推荐答案

如前所述,不要重新发明轮子,只需增强它.

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

Checkout VCalendar,它是开源的,并且来自 PHP,ASP 和 ASP.Net (C#)!

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

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

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.

更新(2009 年 9 月 30 日):

当然,除非轮子坏了!此外,如果您愿意,您可以涂上一层闪亮的新油漆(即:制作更好的 UI).但至少尝试找到一些基础来构建,因为日历系统可能很棘手(重复事件),并且已经完成了数千次.

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.

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

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