如何在Outlook及Office 365日历链接中配置重复规则RRULE
实现Outlook.com/Office 365日历一键添加重复事件的方案
核心逻辑
Outlook.com与Office 365的日历深度链接原生支持通过recurrence查询参数传递标准RRULE重复规则,无需调整原有链接的其他参数结构,只需将编码后的RRULE规则作为recurrence参数的值追加到链接末尾即可生效。
注意事项
- RRULE字符串需要先进行URL编码,避免其中的冒号、分号等特殊字符被识别为查询参数分隔符,导致规则解析失败
- 支持所有标准RRULE格式规则,包括日/周/月/年重复、重复次数限制、结束日期限制等场景均可兼容
- 若需要配置重复事件的例外日期,暂不支持通过链接参数实现,该类场景仍需使用ICS文件方案
代码示例
Outlook.com 带RRULE参数的一键添加链接
<a href="https://outlook.live.com/calendar/0/deeplink/compose?body=Event%20description%20goes%20here%20for%20recurring%20event%21&enddt=2021-08-20T21%3A45%3A00%2B00%3A00&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=2021-08-20T17%3A15%3A00%2B00%3A00&subject=Event%20Name&recurrence=RRULE%3AFREQ%3DDAILY%3BCOUNT%3D2" title="Save Event in my Calendar" >Add to Calendar</a>
Office 365 带RRULE参数的一键添加链接
<a href="https://outlook.office.com/calendar/0/deeplink/compose?body=Event%20description%20goes%20here%20for%20recurring%20event%21&enddt=2021-08-20T21%3A45%3A00%2B00%3A00&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=2021-08-20T17%3A15%3A00%2B00%3A00&subject=Event%20Name&recurrence=RRULE%3AFREQ%3DDAILY%3BCOUNT%3D2" title="Save Event in my Calendar" >Add to Calendar</a>
内容的提问来源于stack exchange,提问作者ceetee
相关产品推荐
相关产品推荐

