Table_Calendar how to filter only the day of the month

I am currently filling a beautiful Table Calendar ()

To get my data I currently doing this:

 Firestore.instance .collection('nurseries') .document(widget._favoriteNurseryId) .collection('events') .orderBy('eventDateStart') .snapshots(), 

I need to find a solution to filter data only for displayed month on the screen. For now i fetch all events on database. It cost me too many firestore Reads.

1

2 Answers

Update: I initially misunderstood the question. To get start and end date on the calendar you can either listen to on OnSelectedDaySelected and determine start and end dates based on calendar format.

Or

Listen to OnCalendarCreated and OnVisibleDaysChaned event callbacks to get start and end dates on the calendar.

Refer:

Sounds like you need to query the data instead of fetching everything. Following query should work:

Firestore.instance .collection('nurseries') .document(widget._favoriteNurseryId) .collection('events') .orderBy('eventDateStart') .startAt('startDate') // startAfter .endAt('endDate') // endBefore .snapshots() 
1

I couldn't understand you question well but, I think you search about

FieldValue.serverTimestamp()

Try it

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like