2

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.

1
  • Could you post what the actual value and format returned is? Commented May 27, 2014 at 16:30

1 Answer 1

1

I got the correct result from the event in SharePoint with .toISOString() on startDate, and then I could use that value with the users current date to get what I wanted.

1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.