在 Outlook 中将重复约会安排为定期事件Schedule repeating appointments as recurring events in Outlook

定期事件是 Outlook 日历的重要组成部分。Recurring events are an important part of Outlook calendaring. 无论是与经理每周进行的一对一会议,还是每月第二个星期二的部门评审会议,定期规则只需要创建一次事件,然后让服务器填充系列中的其他内容,从而使过程变得简单。Whether it's a weekly one-on-one meeting with your manager, or a division-wide review meeting that happens on the second Tuesday of each month, recurring events make it easy to create the event once, and let the server fill in the rest of the series.

使定期事件得以“扩展”为单个事件的关键信息点在于定期规则。The key bit of information that allows recurring events to "expand" into individual occurrences is the recurrence rule. 此规则同时指定事件重复的频率和持续时间。The rule specifies both how often an event repeats, and for how long. Outlook REST API 在事件资源重复周期属性中模拟定期规则。The Outlook REST APIs model recurrence rules in the recurrence property of the event resource.

每个重复周期由两部分组成:定期模式(频率)和定期范围(持续时间)。Each recurrence is made up of two parts: the recurrence pattern (how often), and the recurrence range (for how long).

定期模式Recurrence patterns

重复的第一部分是模式。The first part of a recurrence is the pattern. 它指定事件重复的频率。This specifies how often the event repeats. 例如,一个事件可以“每 3 天”、“每周四”或“每年的 7 月 22 日”重复一次。For example, an event could repeat "every 3 days," "every Thursday," or "on July 22 every year." 在 API 中,模式由 recurrencePattern 资源表示。A pattern is represented in the API by the recurrencePattern resource.

recurrencePattern 的特定字段是必需、可选还是忽略取决于模式的类型。Depending on the type of pattern, certain fields of the recurrencePattern are required, optional, or ignored.

注意:即使将字段忽略,仍需验证该字段。Note: Even if a field is ignored, it is still validated. 如果字段包含一组可能值的列表,那么使用允许集以外的值会导致错误,即使此字段已被忽略也是如此。If a field has a set list of possible values, using a value outside the allowed set causes an error, even if that field is ignored.

让我们来看看每个可能的模式类型。Let's take a look at each of the possible pattern types.

每天Daily

每天定期模式会导致事件基于每次事件之间的天数重复。The daily recurrence pattern causes an event to repeat based on a number of days between each occurrence.

相关属性Relevant properties

属性Property 相关性Relevance 说明Description
intervalinterval 必需Required 指定每次事件之间的天数。Specifies the number of days between each occurrence.
typetype 必需Required 必须设置为 dailyMust be set to daily.

示例Examples

  • 每天重复此事件Repeat this event every day

      "pattern": {
        "type": "daily",
        "interval": 1
      }
    
  • 每三天重复此事件Repeat this event every three days

      "pattern": {
        "type": "daily",
        "interval": 3
      }
    

每周Weekly

每周定期模式使事件基于每组事件之间的周数,在每周的同一天或几天重复。The weekly recurrence pattern causes an event to repeat on the same day or days of the week, based on the number of weeks between each set of occurrences.

相关属性Relevant properties

属性Property 相关性Relevance 说明Description
daysOfWeekdaysOfWeek 必需Required 指定事件发生在每周的哪一天/哪几天。Specifies on which day(s) of the week the event occurs.
firstDayOfWeekfirstDayOfWeek 可选Optional 指定将哪一天视为一周的第一天。Specifies which day is considered the first day of the week. 默认值为:SundayDefault value: Sunday.
intervalinterval 必需Required 指定每组事件之间的周数。Specifies the number of weeks between each set of occurrences.
typetype 必需Required 必须设置为 weeklyMust be set to weekly.

示例Examples

  • 每周四重复此事件Repeat this event every Thursday

      "pattern": {
        "type": "weekly",
        "interval": 1,
        "daysOfWeek": [ "Thursday" ]
      }
    
  • 每隔一个周一和周二重复此事件Repeat this event every other Monday and Tuesday

      "pattern": {
        "type": "weekly",
        "interval": 2,
        "daysOfWeek": [
          "Monday",
          "Tuesday"
        ]
      }
    

绝对每月Absolute monthly

绝对每月模式使事件在每个月的同一天(例如,15日)重复,它基于每次事件之间的月数。The absolute monthly pattern causes an event to repeat on the same day of the month (for example, the 15th), based on the number of months between each occurrence.

相关属性Relevant properties

属性Property 相关性Relevance 说明Description
dayOfMonthdayOfMonth 必需Required 指定事件发生在每月的哪一天。Specifies on which day of the month the event occurs.
intervalinterval 必需Required 指定每次事件之间的月数。Specifies the number of months between each occurrence.
typetype 必需Required 必须设置为 absoluteMonthlyMust be set to absoluteMonthly.

示例Examples

  • 在每月的 15 号重复此事件。Repeat this event on the 15th of every month

      "pattern": {
        "type": "absoluteMonthly",
        "interval": 1,
        "dayOfMonth": 15
      }
    
  • 按季度(每 3 个月)在 7 号重复此事件Repeat this event quarterly (every 3 months) on the 7th

      "pattern": {
        "type": "absoluteMonthly",
        "interval": 3,
        "dayOfMonth": 7
      }
    

相对每月Relative monthly

相对每月模式使事件基于每次事件之间的月数,在每个月同一相对位置中每周的同一天重复。The relative monthly pattern causes an event to repeat on the same day of the week in the same relative position in the month, based on the number of months between each occurrence. 例如,“每月的第二个星期三”。For example, "every second Wednesday of the month."

相关属性Relevant properties

属性Property 相关性Relevance 说明Description
daysOfWeekdaysOfWeek 必需Required 指定事件发生在一周的哪一天/哪几天。Specifies on which day(s) of the week the event can occur. 相对每月事件每月仅发生一次,因此,如果指定多个值,事件会在满足模式的第一天发生。Relative monthly events only occur once per month, so if more than one value is specified, the event falls on the first day that satisfies the pattern.
indexindex 可选Optional 指定事件在 daysOfsWeek 中指定的允许天数的哪个实例上发生,从当月的第一个实例开始计数。Specifies on which instance of the allowed days specified in daysOfsWeek the event occurs, counted from the first instance in the month. 可能的值是:firstsecondthirdfourthlastPossible values: first, second, third, fourth, and last. 默认值为:firstDefault value: first.
intervalinterval 必需Required 指定每次事件之间的月数。Specifies the number of months between each occurrence.
typetype 必需Required 必须设置为 relativeMonthlyMust be set to relativeMonthly.

示例Examples

  • 在每月的第二个星期三重复此事件Repeat this event on the second Wednesday of every month

      "pattern": {
        "type": "relativeMonthly",
        "interval": 1,
        "daysOfWeek": [ "Wednesday" ],
        "index": "second"
      }
    
  • 在每月的第一个星期四或星期五重复此事件Repeat this event on the first Thursday or Friday of every month

      "pattern": {
        "type": "relativeMonthly",
        "interval": 1,
        "daysOfWeek": [ "Thursday", "Friday" ],
        "index": "first"
      }
    

绝对每年Absolute yearly

绝对每年模式使事件在每年的同一月份的同一天(例如,4 月 15 日)重复,它基于每次事件之间的年数。The absolute yearly pattern causes an event to repeat on the same month and day (for example, April 15), based on the number of years between each occurrence.

相关属性Relevant properties

属性Property 相关性Relevance 说明Description
dayOfMonthdayOfMonth 必需Required 指定事件发生在每月的哪一天。Specifies on which day of the month the event occurs.
monthmonth 必需Required 指定事件发生的月份。Specifies in which month the event occurs.
intervalinterval 必需Required 指定每次事件之间的年数。Specifies the number of years between each occurrence.
typetype 必需Required 必须设置为 absoluteYearlyMust be set to absoluteYearly.

示例Example

  • 在每年的 4 月 15 日重复此事件Repeat this event on April 15 every year

      "pattern": {
        "type": "absoluteYearly",
        "interval": 1,
        "dayOfMonth": 15,
        "month": 4
      }
    

相对每年Relative yearly

相对每年模式使事件基于每次事件之间的年数,在特定月份同一相对位置中每周的同一天重复。The relative yearly pattern causes an event to repeat on the same day of the week in the same relative position in a specific month, based on the number of years between each occurrence. 例如,“每个 11 月的最后一个星期三”。For example, "every last Wednesday of November."

相关属性Relevant properties

属性Property 相关性Relevance 说明Description
daysOfWeekdaysOfWeek 必需Required 指定事件发生在一周的哪一天/哪几天。Specifies on which day(s) of the week the event can occur. 相对每年事件每年仅发生一次,因此,如果指定多个值,事件会在满足模式的第一天发生。Relative yearly events only occur once per year, so if more than one value is specified, the event falls on the first day that satisfies the pattern.
indexindex 可选Optional 指定事件在 daysOfsWeek 中指定的允许天数的哪个实例上发生,从当月的第一个实例开始计数。Specifies on which instance of the allowed days specified in daysOfsWeek the event occurs, counted from the first instance in the month. 可能的值是:firstsecondthirdfourthlastPossible values: first, second, third, fourth, and last. 默认值为:firstDefault value: first.
monthmonth 必需Required 指定事件发生的月份。Specifies in which month the event occurs.
intervalinterval 必需Required 指定每次事件之间的年数。Specifies the number of years between each occurrence.
typetype 必需Required 必须设置为 relativeYearlyMust be set to relativeYearly.

示例Examples

  • 每年 11 月的最后一个星期三重复此事件Repeat this event on the last Wednesday of November every year

      "pattern": {
        "type": "relativeYearly",
        "interval": 1,
        "daysOfWeek": [ "Wednesday" ],
        "index": "last",
        "month": 11
      }
    

定期范围Recurrence ranges

重复的第二部分是范围。The second part of a recurrence is the range. 它指定模式重复的持续时间。This specifies how long the pattern repeats. 例如,一个事件可以在发生 10 次后于特定日期结束,也可以不结束。For example, an event could end after 10 occurrences, by a specific date, or could have no end. 在 API 中,由 recurrenceRange 资源表示范围。A range is represented in the API by the recurrenceRange resource.

recurrenceRange 的特定字段是必需还是忽略取决于范围的类型。Depending on the type of range, certain fields of recurrenceRange are required or ignored.

注意:即使将字段忽略,仍需验证该字段。Note: Even if a field is ignored, it is still validated. 如果字段包含一组可能值的列表,那么使用允许集以外的值会导致错误,即使此字段已被忽略也是如此。If a field has a set list of possible values, using a value outside the allowed set causes an error, even if that field is ignored.

让我们来看看每个可能的范围类型。Let's take a look at each of the possible range types.

编号的范围Numbered range

编号的范围使事件(基于模式)从开始日期起按固定次数发生。The numbered range causes an event to occur a fixed number of times (based on the pattern) from a start date.

相关属性Relevant properties

属性Property 相关性Relevance 说明Description
numberOfOccurencesnumberOfOccurences 必需Required 指定事件发生的次数。Specifies the number of occurrences. 必须是正整数。Must be a positive integer.
recurrenceTimeZonerecurrenceTimeZone 可选Optional 指定 startDate 属性的时区。Specifies the time zone for the startDate property. 如果未指定,将使用事件时区。If not specified, the time zone of the event is used.
startDatestartDate 必需Required 指定开始应用模式的日期。Specifies the date to start applying the pattern. startDate 的值必须与事件资源上的 start 属性的日期值对应。The value of startDate MUST correspond to the date value of the start property on the event resource. 请注意,如果日期不符合模式,第一次会议可能不会在此日期发生。Note that the first occurrence of the meeting may not occur on this date if it does not fit the pattern.
typetype 必需Required 必须设置为 numberedMust be set to numbered.

示例Examples

  • 此事件重复 10 次Repeat this event 10 times

      "range": {
        "type": "numbered",
        "startDate": "2017-04-02",
        "numberOfOccurrences": 10
      }
    

结束日期范围End date range

结束日期范围使事件在开始日期和结束日期之间匹配适用模式的所有天数发生。The end date range causes an event to occur on all days that fit the applicable pattern between a start date and an end date.

相关属性Relevant properties

属性Property 相关性Relevance 说明Description
endDateendDate 必需Required 指定停止应用模式的日期。Specifies the date to stop applying the pattern. 请注意,如果日期不符合模式,最后一次会议可能不会在此日期发生。Note that the last occurrence of the meeting may not occur on this date if it does not fit the pattern.
recurrenceTimeZonerecurrenceTimeZone 可选Optional 指定 startDateendDate 属性的时区。Specifies the time zone for the startDate and endDate properties. 如果未指定,将使用事件时区。If not specified, the time zone of the event is used.
startDatestartDate 必需Required 指定开始应用模式的日期。Specifies the date to start applying the pattern. startDate 的值必须与事件资源上的 start 属性的日期值对应。The value of startDate MUST correspond to the date value of the start property on the event resource. 请注意,如果日期不符合模式,第一次会议可能不会在此日期发生。Note that the first occurrence of the meeting may not occur on this date if it does not fit the pattern.
typetype 必需Required 必须设置为 endDateMust be set to endDate.

示例Examples

  • 从 2017 年 7 月 1 日到 2017 年 7 月 31 日重复此事件Repeat this event from July 1, 2017, to July 31, 2017

      "range": {
        "type": "endDate",
        "startDate": "2017-07-01",
        "endDate": "2017-07-31"
      }
    

无结束范围No end range

无结束区域使事件在开始日期后匹配适用模式的所有天数发生。The no end range causes an event to occur on all days that fit the applicable pattern after a start date.

相关属性Relevant properties

属性Property 相关性Relevance 说明Description
recurrenceTimeZonerecurrenceTimeZone 可选Optional 指定 startDate 属性的时区。Specifies the time zone for the startDate property. 如果未指定,将使用事件时区。If not specified, the time zone of the event is used.
startDatestartDate 必需Required 指定开始应用模式的日期。Specifies the date to start applying the pattern. startDate 的值必须与事件资源上的 start 属性的日期值对应。The value of startDate MUST correspond to the date value of the start property on the event resource. 请注意,如果日期不符合模式,第一次会议可能不会在此日期发生。Note that the first occurrence of the meeting may not occur on this date if it does not fit the pattern.
typetype 必需Required 必须设置为 noEndMust be set to noEnd.

示例Examples

  • 从 2017 年 5 月 15 日起重复此事件,无结束日期Repeat this event from May 15, 2017, forever

      "range": {
        "type": "noEnd",
        "startDate": "2017-05-15"
      }
    

使用模式和范围创建定期事件Using patterns and ranges to create recurring events

我们已经分别查看了模式和范围,让我们再来了解一下它们如何协同工作以及如何与事件中的 startend 属性交互。Now that we've looked at patterns and ranges separately, let's look at how they work together and how they interact with the start and end properties on the event.

创建定期规则Creating a recurrence rule

如要创建定期规则,必须同时指定模式和范围。To create a recurrence rule, you must specify both a pattern and a range. 模式类型与范围类型可任意搭配使用。Any pattern type can work with any range type. 以下是一些示例。Here are a few examples.

示例Examples

  • 从 2017 年 9 月 4 日开始直到年底,在每周一的下午 1:00 - 1:30 会面Meet from 1:00 PM to 1:30 PM every Monday starting September 4, 2017, until the end of the year

    • weekly 定期模式类型可轻松实现“每周一”的要求。The "every Monday" requirement is easily met by the weekly recurrence pattern type.
    • “直到年底”的要求表示 endDate 定期范围类型。The "until the end of the year" requirement indicates an endDate recurrence range type.
      "recurrence": {
        "pattern": {
          "type": "weekly",
          "interval": 1,
          "daysOfWeek": [ "Monday" ]
        },
        "range": {
          "type": "endDate",
          "startDate": "2017-09-04",
          "endDate": "2017-12-31"
        }
      }
    

    由于 2017 年 12 月 31 日是周日,因此,此系列的最后一次事件将于 12 月 25 日星期一发生。Because December 31, 2017, is on a Sunday, the last occurrence in this series will be on Monday, December 25.

  • 从 2017 年 8 月 29 日开始,在每两个月的第一个星期四的下午 2:00 - 3:00 会面Meet from 2:00 PM to 3:00 PM on the first Thursday of every other month starting August 29, 2017

    • 使用相对每月模式可实现“每两个月的第一个星期四”的要求。The "first Thursday of every other month" requirement is achievable by using a relative monthly pattern. “每两个月”部分表示应将 interval 设置为 2The "every other month" portion indicates that the interval should be set to 2.
    • 由于结束日期没有要求,可使用 noEnd 范围类型。Because there is no requirement on an end date, a noEnd range type can be used.
      "recurrence": {
        "pattern": {
          "type": "relativeMonthly",
          "interval": 2,
          "daysOfWeek": [ "Thursday" ],
          "index": "first"
        },
        "range": {
          "type": "noEnd",
          "startDate": "2017-08-29"
        }
      }
    

    由于 startDate 的值在 8 月的第一个星期四之后,因此,此系列的第一次事件将在 9 月发生。Because the value of startDate is after the first Thursday in August, the first occurrence of this series will be in September.

后续步骤Next steps

了解更多关于与 Outlook 日历集成的信息。Find out more about integrating with Outlook calendar.