Skip to content

Conversation

nikie
Copy link
Contributor

@nikie nikie commented Dec 24, 2017

Date was pushed as string to events list in /add_event endpoint. As a result, when trying to refresh page after adding an event, the following error appeared in the server log and page was not refreshed:

[Vue warn]: Error in render: "TypeError: event.date.isSame is not a function"
found in
---> <CalendarDay> at /home/nik/projl/vue-ult-course/vuejs-calendar/src/components/CalendarDay.vue
       <App> at /home/nik/projl/vue-ult-course/vuejs-calendar/src/components/App.vue
         <Root>
TypeError: event.date.isSame is not a function
    at $store.state.events.filter.event (__vue_ssr_bundle__:30166:72)
...

This fix converts the date received from browser to a moment object before pushing to the events list.

@anthonygore anthonygore merged commit ee503a9 into vuejsdevelopers:lecture/177 Apr 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants