I have been struggling with comparing dates from my calendar app to dates stored in Firestore. The issue arises because Firestore returns timestamps, and I need to compare them to regular Date objects.
Is there a workaround for this problem? Can something like the following code snippet work?
async function getBaristaShift(date: Date, db: Firestore) {
date.setHours(0, 0, 0, 0);
const shiftsRef = collection(db, "shifts");
const queryStatement = query(shiftsRef, where("date", "==", date)
}
getBaristaShift(new Date(now), dbRef);
It seems that this approach won't yield any results due to the mismatch in date formats between the calendar date and the timestamp in Firestore.