如何使用Google日历API获取多日事件的事件实例?(How to get the event instances of a multi

编程入门 行业动态 更新时间:2024-10-19 04:21:05
如何使用Google日历API获取多日事件的事件实例?(How to get the event instances of a multi-day events using google calendar API?)

我正在开发一个演示项目,我需要从谷歌日历中提取所有事件并将其显示在主页中。我正在使用gapi来获取事件。

提取属性的singleEvents为true,showDeleted为true。

我也获得了重复事件的所有事件和实例。但是,多天事件的实例,例如从1月1日开始到1月5日结束的事件不会被复制,而且我只获得一个具有开始日期的事件作为1月1日。 任何人都可以提出为什么多日事件的事件没有被提取?

I am working on a demo project where I need to fetch all events from the google calendar and show it in the home page.I am using gapi to fetch the events.

The properties for fetching has singleEvents as true and showDeleted as true.

I get all the events and instances of the recurring events as well.However the instances of a multiday event, for example an event that starts at Jan 1st and ends at Jan5th doesn't get replicated and I get only one event that has start date as Jan 1st. Could anyone suggest why the event instances of multi-day events are not being fetched?

最满意答案

这就是Google日历的工作原理。 单个事件具有开始日期时间和结束日期时间。 即使发生了几天,也只有一个事件。

如果您想要检索多个事件,则需要为每个要查找的时间框架插入一个事件。

Google不会为您产生事件,它只会返回它所拥有的数据。

That is how Google Calendar works. A single event has a start datetime and an end datetime. There is only one event even though it occurs over several days.

If you want to retrieve multiple events you will need to insert an event for each time frame you are looking for.

Google is not going to spawn events for you it will only return the data it has.

更多推荐

本文发布于:2023-04-28 07:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1330316.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:事件   如何使用   多日   实例   日历

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!