如何为日历事件创建重复规则

时间:2019-07-16 08:54:45

标签: google-calendar-api

我要为事件设置重复规则。

  1. 事件持续了特定的几天(例如,从7月16日到7月25日)

  2. 对于那些日子,我希望在上午9:00至下午4:00之间每20分钟发送一次通知

这些是我尝试过的一些规则

我在下面的代码块中的重复规则字段中使用以下重复规则作为字符串

RRULE:FREQ = DAILY; BYHOUR = 9,10,11,12,13,14,15,16; BYMINUTE = 0,20,40; UNTIL = 20190708T170000Z

RRULE:FREQ = DAILY; BYMINUTE = 0,20,40; UNTIL = 20190708T170000Z

RRULE:FREQ = MINUTELY; INTERVAL = 15; BYHOUR = 8,9,10,11,12,13,14,15,16; UNTIL = 20190708T170000Z

Event event = new Event()
{
  Summary = "Appointment",
  Location = "Somewhere",
  Start = new EventDateTime() {
      DateTime = new DateTime("2011-06-03T10:00:00.000:-07:00")
      TimeZone = "America/Los_Angeles"
  },
  End = new EventDateTime() {
      DateTime = new DateTime("2011-06-03T10:25:00.000:-07:00")
      TimeZone = "America/Los_Angeles"
  },
  Recurrence = new String[] {
      "RRULE:FREQ=MINUTELY;INTERVAL=15;BYHOUR=8,9,10,11,12,13,14,15,16;UNTIL=20190708T170000Z"
  },
  Attendees = new List<EventAttendee>()
      {
        new EventAttendee() { Email: "attendeeEmail" },
      }
};

预期结果

  • 日历事件警报每20分钟响一次

实际结果

  • 每20分钟8个完全相同的日历事件闹钟响

0 个答案:

没有答案