我正在使用 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 似乎不喜欢这样,它抱怨不兼容的二元运算符)。
谁能建议我需要在参数中修改什么才能恢复今天安排的活动?
谢谢