我正在使用AppointmentCalendar
将约会保存到AppointmentCalendar.SaveAppointmentAsync(...)
。此约会是包含Recurrence
信息的系列的主。
保存约会后,我使用约会的GetAppointmentAsync
在同一日历上调用LocalId
,再次检索同一个约会。
以下是意外行为:加载的约会存在差异:Recurrence.Until
日期关闭一个。
这是为什么?
以下是序列化为JSON的约会约会:
Appointment
我保存:
{
"Location": "",
"AllDay": false,
"Organizer": null,
"Duration": "00:45:00",
"Details": "",
"BusyStatus": 0,
"Recurrence": {
"Unit": 1,
"Occurrences": 260,
"Month": 1,
"Interval": 1,
"DaysOfWeek": 62,
"Day": 1,
"WeekOfMonth": 0,
"Until": "2016-12-31T01:00:00+01:00",
"TimeZone": "Europe/Budapest",
"RecurrenceType": 0,
"CalendarIdentifier": ""
},
"Subject": "test",
"Uri": null,
"StartTime": "2016-01-04T11:30:00+01:00",
"Sensitivity": 0,
"Reminder": null,
"Invitees": {},
"AllowNewTimeProposal": true,
"UserResponse": 0,
"RoamingId": "c,b,fd",
"ReplyTime": null,
"IsResponseRequested": true,
"IsOrganizedByUser": false,
"IsCanceledMeeting": false,
"OnlineMeetingLink": "",
"HasInvitees": false,
"CalendarId": "b,37,355",
"LocalId": "c,37,20a3",
"OriginalStartTime": null,
"RemoteChangeNumber": 0,
"DetailsKind": 0,
"ChangeNumber": 39537577
}
在通过调用Appointment
检索它之后,这是同一个GetAppointmentAsync
:
{
"Location": "",
"AllDay": false,
"Organizer": null,
"Duration": "00:45:00",
"Details": "",
"BusyStatus": 0,
"Recurrence": {
"Unit": 1,
"Occurrences": 260,
"Month": 1,
"Interval": 1,
"DaysOfWeek": 62,
"Day": 1,
"WeekOfMonth": 0,
"Until": "2016-12-30T01:00:00+01:00",
"TimeZone": "Europe/Budapest",
"RecurrenceType": 0,
"CalendarIdentifier": "GregorianCalendar"
},
"Subject": "test",
"Uri": null,
"StartTime": "2016-01-04T11:30:00+01:00",
"Sensitivity": 0,
"Reminder": null,
"Invitees": {},
"AllowNewTimeProposal": true,
"UserResponse": 0,
"RoamingId": "c,b,fd",
"ReplyTime": null,
"IsResponseRequested": true,
"IsOrganizedByUser": false,
"IsCanceledMeeting": false,
"OnlineMeetingLink": "",
"HasInvitees": false,
"CalendarId": "b,37,355",
"LocalId": "c,37,20a3",
"OriginalStartTime": null,
"RemoteChangeNumber": 0,
"DetailsKind": 0,
"ChangeNumber": 39537577
}
区分这些JSON,您会在Recurrence
部分得到两个不同之处:
CalendarIdentifier
在保存的原始约会中为空(因为setter是私有的)。但更重要的是:Recurrence.Until
不同!
Recurrence.Until
预约保存:“2016-12-31T01:00:00 + 01:00”
Recurrence.Until
加载后预约:“2016-12-30T01:00:00 + 01:00”
有一天不见了。
这是为什么?保存约会时我还需要做什么吗?或者更糟糕的是:它只是我的日历和约会的边缘情况,甚至可能连接到当前日期?
(SDK Version 10.0.14393.0,Win 10 Anniversary)
答案 0 :(得分:1)