Hi,
I’m trying to let users search for other users using date/time range filters.
- Each user can set their own available time slots, which will be stored in the user DB as a list of date ranges.
- Users can filter other users by selecting a date range, and users who have available time slots within this selected time range will be displayed in the result.
For example, user A added 25, 27, and 29 Jul 4 - 6 pm as available time slots.
And another user - User B, is searching for all users who have available time slots in 24 to 26 Jul.
So user A will appear in the search result.
In my User collection db, I’ve added a list of date ranges - “timerange”.
I am able to show user A in the filter result, when I specify in the advance filter the item number (first item/ item#) in the list of date ranges. i.e. timerange:item#1 overlaps with AirDate/Time Picker A’s value <-range-> AirDate/Time Picker B’s value
But how can I check all the items in the list of date ranges instead of only checking one item in the list?
Do I need to do a loop? or should I create another collection in db that stores all users and stores all their available time slots as “a date range” instead of “a list of date ranges”?
I’m not from a technical background, and I’ve been stuck on this problem for a very long time! Hope someone can help! Thank you very much!