【发布时间】:2016-10-28 08:16:41
【问题描述】:
我正在使用 Node(特别是 node-outlook npm 模块)来查看我的 Outlook.com 日历,并且基本请求正在运行。我正在从 API 中取回结果,但是我无法使用 oData 请求参数来仅返回今天的结果。这是我得到的:
var queryParams = {
'$select': 'Subject,Start,End',
'$orderby': 'Start/DateTime desc',
//'$top': 10,
'startDateTime': startDateString,
'endDateTime': endDateString
//'$filter': "Start/DateTime ge " + startDateString + " and Start/DateTime le " + endDateString
};
outlook.base.setApiEndpoint('https://outlook.office.com/api/v2.0');
outlook.base.setAnchorMailbox(<my email address>);
outlook.base.setPreferredTimeZone('Europe/London');
outlook.calendar.getEvents({token:token, odataParams: queryParams},function(error, result){
//Do some stuff with the event data here
}
但是,如果我使用上面显示的参数(其中 startDateString 是 2016-10-28T00:00:00 和 endDateString 是 2016-10-28T23:59:59),我仍然会返回过去和未来的事件。
这不是我想要的——我希望做的只是完成当前的事件(因此尝试使用 oData $filter,但 API 似乎不喜欢这样,它呻吟着关于不兼容的二元运算符)。
谁能建议我需要在参数中修改什么才能恢复今天安排的活动?
谢谢
【问题讨论】:
标签: node.js office365 outlook.com outlook-api