0

I am using the angular-ui directive to show a calendar with events. The data coming back from my api is not in the correct format for the calendar, so I do some prepping of the events using underscore's map function.

My calendar with events renders fine in chrome. In Safari, the events do not render on the calendar. I am guessing that it has to do with my prepping the events before hand (although, really I'm not sure).

My question is: if this isn't the correct way to prep the events before rendering them, then what is? And if anyone can help me get my events to render in Safari, that'd be great.

Here is a plunker demonstrating the issue. Opening it in chrome, everything is fine. In Safari: not fine. Also, the events don't render in IE9 either (although, I am less concerned about that).

1 Answer 1

1

The problem is how you are trying to convert the dates. In chrome the extra bit after the . is a valid date, but in safari it causes the start and end dates to be Invalid Dates.

All I did was change the toDate function to return this new Date(this.split('.')[0]) and it works. http://plnkr.co/edit/A7Nss1T2bSlZHXd2bg5M?p=preview

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.