Recurrence.Range.StartDate / EndDate contain timezone offset

馋奶兔 提交于 2020-01-05 04:53:45

问题


Recurrence rule dates contain timezone offset where the calendar event "Start" / "End" fields are in UTC which seems incorrect behavior (Bug?). Did anyone knows why the "Recurrence.Range" "StartDate" / "EndDate" fields contains dates which are not UTC? Expected behavior is to receive UTC dates for all date fields in the calendar event object.

{
    "@odata.id": "https://outlook.office365.com/api/v1.0/Users('EXAMPLEUSER')",
    "@odata.etag": "ETAG",
    "Id": "EXAMPLEID",
    "ChangeKey": "GnglO5JwUUGYx+QpS/Qc5AAABbYSpQ==",
    "Categories": [],
    "DateTimeCreated": "2015-05-14T13:52:41.9129608Z",
    "DateTimeLastModified": "2015-05-14T13:52:41.9285866Z",
    "Subject": "Every monday",
    "BodyPreview": "adsasdsa",
    "Body": {
        "ContentType": "HTML",
        "Content": "adsasdsa"
    },
    "Importance": "Normal",
    "HasAttachments": false,
    //Notice the format of the date - correctly comes in UTC:
    "Start": "2015-05-11T00:00:00Z",
    "StartTimeZone": "UTC",
    //Notice the format of the date - correctly comes in UTC:
    "End": "2015-05-12T00:00:00Z",
    "EndTimeZone": "UTC",
    "Reminder": null,
    "Location": {
        "DisplayName": "",
        "Address": {
            "Street": "",
            "City": "",
            "State": "",
            "CountryOrRegion": "",
            "PostalCode": ""
        },
        "Coordinates": {
            "Accuracy": "NaN",
            "Altitude": "NaN",
            "AltitudeAccuracy": "NaN",
            "Latitude": "NaN",
            "Longitude": "NaN"
        }
    },
    "ResponseStatus": {
        "Response": "Organizer",
        "Time": "0001-01-01T00:00:00Z"
    },
    "ShowAs": "Free",
    "IsAllDay": true,
    "IsCancelled": false,
    "IsOrganizer": true,
    "ResponseRequested": true,
    "Type": "SeriesMaster",
    "SeriesMasterId": null,
    "Attendees": [],
    "Recurrence": {
        "Pattern": {
            "Type": "Weekly",
            "Interval": 1,
            "Month": 0,
            "Index": "First",
            "FirstDayOfWeek": "Sunday",
            "DayOfMonth": 0,
            "DaysOfWeek": ["Monday"]
        },
        "Range": {
            "Type": "NoEnd",
            //Notice the format of the date - it's not UTC:
            "StartDate": "2015-05-11T00:00:00+03:00",
            "EndDate": "0001-01-01T00:00:00Z",
            "NumberOfOccurrences": 0
        }
    },
    "Organizer": {
        "EmailAddress": {
            "Address": "vladimir@kendouischeduler.tk",
            "Name": "vladimir iliev"
        }
    },
    "iCalUId": "EXAMPLEICALUID",
    "WebLink": "EXAMPLEWEBLINK"
}

I'm currently working on integration between Office365 calendar events and third-party client-side Scheduler widgets (which supports only iCal recurrence rule) and doesn't know how to interpret correctly the above dates in recurrence "Range" object.


回答1:


This appears to be a bug in the API. We have a work item to investigate and fix it, but I don't have any timeframes to share.



来源:https://stackoverflow.com/questions/30240016/recurrence-range-startdate-enddate-contain-timezone-offset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!