是否有将 ical 链接作为输入来显示事件的 javascript 日历?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4671764/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a javascript calendar that takes an ical link as input to display events?
提问by mikepinch
I am looking for a javascript based calendar that will allow me to specify a remote ical file to use as the source for the events.
我正在寻找一个基于 javascript 的日历,它允许我指定一个远程文件作为事件的源。
I know google will allow you to import the ical then view the calendar via js or iframe, but I need to keep this agnostic to individual user accounts of any time.
我知道 google 将允许您导入 ical 然后通过 js 或 iframe 查看日历,但我需要随时保持对个人用户帐户的不可知性。
Any suggestions?
有什么建议?
Thanks
谢谢
回答by Riley Dutton
If you have access to an "in between", you could probably do something with this (or a similar class in the language of your choice):
如果您可以访问“中间”,您可能可以用它(或您选择的语言的类似类)做一些事情:
http://www.phpclasses.org/package/3278-PHP-Parse-and-extract-event-information-from-iCalendar.html
http://www.phpclasses.org/package/3278-PHP-Parse-and-extract-event-information-from-iCalendar.html
and jQuery Week Calendar, which is great:
和 jQuery Week Calendar,这很棒:
https://github.com/robmonie/jquery-week-calendar
https://github.com/robmonie/jquery-week-calendar
You would basically just convert the iCal format to JSON on the fly in a PHP script.
您基本上只需在 PHP 脚本中即时将 iCal 格式转换为 JSON。
回答by Fritz
This may not be a complete answer but I think it's a useful pointer in the right direction.
这可能不是一个完整的答案,但我认为这是指向正确方向的有用指针。
There's a project called jqcaldav, which is (as the name suggests) not exactly an iCalendar (ics) viewer but a CalDAV client. So far I haven't found a way to specify an ics URL to display directly.
有一个名为jqcaldav的项目,它(顾名思义)不完全是一个 iCalendar (ics) 查看器,而是一个 CalDAV 客户端。到目前为止,我还没有找到一种方法来指定直接显示的 ics URL。
However, since the CalDAV protocol uses the iCalendar format to store and communicate Calendar data, the jqcaldav project shouldcontain some code to parse and display iCalendar Data. Maybe examining the code can be a useful exercise and lead to the development of a standalone ics viewer. I would also be highly interested in a working solution, but so far I haven't had time to put something together myself.
但是,由于 CalDAV 协议使用 iCalendar 格式来存储和传递日历数据,因此 jqcaldav 项目应该包含一些代码来解析和显示 iCalendar 数据。也许检查代码可能是一个有用的练习,并导致开发独立的 ics 查看器。我也会对一个可行的解决方案非常感兴趣,但到目前为止我还没有时间自己整理一些东西。
A quick analysis shows that there are indeed two files that are seemingly concerned with the iCalendar format: ical.jsand jical.js. Examining the source code reveals that another file called ics-parser.jsis used. Also, the calendar solution was apparently released under a CC-By-License, encouraging reuse in other projects.
快速分析表明确实有两个文件似乎与 iCalendar 格式有关:ical.js和jical.js. 检查源代码显示使用了另一个调用的文件ics-parser.js。此外,日历解决方案显然是在 CC-By-License 下发布的,鼓励在其他项目中重用。
If someone creates a project based on this, I'd glad to know of it or even join in.
如果有人基于此创建一个项目,我很乐意知道甚至加入。
回答by User
回答by spinon
Here is a link on sourceforge to something. Not sure if it works but wanted to at least provide something. http://sourceforge.net/projects/jsicsparser/
这是 sourceforge 上的链接。不确定它是否有效,但至少想提供一些东西。http://sourceforge.net/projects/jsicsparser/

