I've solved it by trying a different approach of string concatenation, and I've used the datetimeoffset
while formatting the date to toISOString()
static async fetchRecentProjectTasks(odataHandler) {
var pastFiveMinutes = moment().subtract(5, 'minutes').toISOString();
return await odataHandler.get('ProjectTaskCollection').query({
$top: parseInt(20000),
$filter: "LastChangeDateTime ge datetimeoffset'" + pastFiveMinutes + "'",
$select: "ObjectID,ID,Name,EarliestPlannedStartDateTime,EarliestPlannedEndDateTime,LastChangeDateTime,ProjectTaskService",
$orderby: "ObjectID",
"$expand": "ProjectTaskService,ProjectTaskService/ServiceProductDescription,ProjectTaskService/ProjectTaskServicePeriodPlan",
$format: 'json'
}).catch(err => {
console.log(err.url);
});
}
I don't understand what was wrong in the first query but whatever, as long as it works
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…