我不清楚确切的格式,有一个网站上的链接,将添加一个单一的事件到用户谷歌日历。我看到eventbrite在这里做到了这一点,但我希望有一些明确的规范或正确方向的链接
发布于 2019-01-14 06:15:14
谷歌日历和其他日历服务有一个全面的文档:https://github.com/InteractionDesignFoundation/add-event-to-calendar-docs/blob/master/services/google.md
工作链接的示例:https://calendar.google.com/calendar/render?action=TEMPLATE&text=Bithday&dates=20201231T193000Z/20201231T223000Z&details=With%20clowns%20and%20stuff&location=North%20Pole
发布于 2020-02-22 01:27:38
我还成功地使用了这个URL结构:
基本URL:
https://calendar.google.com/calendar/r/eventedit?
假设这是我的事件详细信息:
Title: Event Title
Description: Example of some description. See more at https://stackoverflow.com/questions/10488831/link-to-add-to-google-calendar
Location: 123 Some Place
Date: February 22, 2020
Start Time: 10:00am
End Time: 11:30am
Timezone: America/New York (GMT -5)
我会将我的详细信息转换为以下参数(URL编码):
text=Event%20Title
details=Example%20of%20some%20description.%20See%20more%20at%20https%3A%2F%2Fstackoverflow.com%2Fquestions%2F10488831%2Flink-to-add-to-google-calendar
location=123%20Some%20Place%2C%20City
dates=20200222T100000/20200222T113000
ctz=America%2FNew_York
示例链接:
请注意,因为我已经使用"ctz“参数指定了一个时区,所以我使用本地时间作为开始和结束日期。或者,您可以使用UTC日期并排除时区参数,如下所示:
dates=20200222T150000Z/20200222T163000Z
示例链接:
发布于 2020-03-20 05:57:13
对于下一个用Google搜索这个主题的人,我已经编写了一个小的NPM包来简化Google Calendar URL的生成。它包括TypeScript类型定义,以满足那些需要的人。希望它能帮上忙!
https://stackoverflow.com/questions/10488831
复制相似问题