Filtering dates by Today, Tomorrow, This weekend

Hi, I’ve trawled through the forum, but I’m about to throw my laptop out the window.

I have events with start date an time

I want to be able to filter events by their start date. So if I select Today events that are on today.

I tried setting the start date to the current time, but I am unable to extract only the date. As the date field contains both date and time I am not getting any results in my repeating group. Help!

image

Are you familiar with the +days function? This should help you achieve what you’re looking to do.

Aug%2020%202018%2011_30%20PM

1 Like

Thanks Dan, I’m aware of this function :slight_smile:

What I want to do is have a navigation similar to the image below. Where once a user clicks on Today, Tomorrow etc it will take them to a list of events that matches the date.

I can set the current date and time for today and tomorrow by adding number of day to my filter, but my result is coming up with blank. I wonder if it’s because my events have both dates and time e.g. 28/8/2018 10:00 AM but I only want the search to be for the date component i.e. 28/8/2018. So this lists out all the events on this date irrespective of the time.

When I use the filter function [Start Date1= Current date / time] this seems to only bring matches where events are today’s date and time. Is there a way to loosen this filter so it only searches for date and not time?

@yasinta1 - I recorded a tutorial video to walk you through the process of setting it up using a state-based approach for setting up conditional data sources.

Essentially, what is happening is that when a time component isn’t specified, the date is saved in the database as midnight. So, in spite of the +days function, when you use the greater than/less than operators for filtering the search, it omits those values. This tutorial will show you how to capture the midnight-based values and dates within the given specified range).

Dan (creator of LearnTo)

13 Likes

Thanks Dan! This is exactly what I was looking for! Thanks for the very clear tutorial, this had been driving me crazy as I thought this might be an out of box solution.

This topic was automatically closed after 70 days. New replies are no longer allowed.