I want to convert the timestamp I get from the Google firestore to days and months in my vueApp.
I get an object like this Object { seconds: 1549843200, nanoseconds: 0 }
<template>
<div v-for="note in notes" :key="note.id" class="note">
<div class="note_dates">
<span class="day">{{note.day}}</span>
<span class="month">{{note.month}}</span>
.........
</template>
<script>
export default {
data() {
return {
notes: []
};
},
methods: {},
created() {
notesCollection.get().then(querySnapshot => {
querySnapshot.forEach(doc => {
const query = {
id: doc.id,
content: doc.data().content,
day: doc.data().created_on,
month: doc.data().created_on
};
this.notes.push(query);
});
});
}
the value created_on
is a timestamp in the firestore collection
So, in my view component, I want to echo just the day and the month from the timestamp.