Skip to content
Advertisement

Parse time simply within Vue method pushing to Firebase DB

I am creating a message board using TipTap in a Vue.js project with a Firebase DB. I would prefer not to have to use moment.js or another library as it seems superfluous.

This is the code for my simple method parse which I feel like is correct. Pretty vanilla JS if you ask me.

JavaScript

I first get a Vue warning saying this –

JavaScript

And then the error saying this –

JavaScript

Advertisement

Answer

you are trying to save a function in the database instead of calling it. Do like this:

JavaScript

instead of passing the timestamp function itself, call it 🙂

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement