I'm trying to get some information from an event from a SharePoint Online list (ex. events start date 25 june 00.00). When I get the results back in a array with JavaScript it returns 25 june 02.00 UTC +0200. How can I get the actual results from the event?
It doesn't say 02.00, just 00.00.
If I remove 2 hours in the code it will cause trouble with day light saving?
var listItemEnumerator = this._calendar.items.getEnumerator();
var calendarList = [];
while (listItemEnumerator.moveNext()) {
var listItem = listItemEnumerator.get_current();
calendarList.push({
startDate: listItem.get_item("EventDate"),
endDate: listItem.get_item("EndDate")
});
}
this._calendar = calendarList;
With this date I'm getting from the calendar I'm comparing with the users current date, but it doesn't matter when the event should for example end on the 22 june 23.59, then the JavaScript add 2 hours, so it shows the end date the 23rd which is wrong.