I'm on a vuejs and firebase project. And I would like to display only the data recorded today. But I don't know how to do it. Can you please help me.
created() {
const dfRef = db.ref("Colis Requetes")
dfRef.orderByChild("created_at").on("value", (dataSnapshot) => {
const itemsArray = [];
dataSnapshot.forEach((childSnapshot) => {
const childData = childSnapshot.val();
const childDataKey = childSnapshot.key;
this.Colis = childData;
itemsArray.push({
id: childDataKey,
client_name: childData.client_name,
client_phone: childData.client_phone,
colis_type: childData.colis_type,
payment_method: childData.payment_method,
});
});
this.Colis = itemsArray.reverse();
});
}
The orderByChild
property is for displaying data from the most recent date to the oldest date. However, I want only the recordings made today to appear on the page.
I'm on a vuejs and firebase project. And I would like to display only the data recorded today. But I don't know how to do it. Can you please help me.