Filter on dates acting (really) weird

Hello,

I am using a bunch of filters on Dates within my Adalo app. I have an Item collection that has a Date type property, and I display these items in a list, filtering on that Date property.
I have witnessed a couple of odd behaviours:

  • If the filter is set to “Tomorrow”, it sometimes shows items with a date equal to 2 days from now, sometimes shows items with a date equal to tomorrow
  • If the filter is set to “2 days from now”, it sometimes shows items tagged as 2 days from now (as expected) but sometimes tagged as Tomorrow (not okay)
  • If the filter is set to “Current time” or “Start of the day”, well anything can happen: nothing shown, today’s items shown, tomorrow’s items shown.

These are not consistent over time and can be working one way today on a given device and another way the next day (same time).

I say sometimes because I have not been able to find a pattern for these, seems like it varies depending on:

  • The day of the week,
  • The time of the day,
  • The device timezone (I have seen different behaviour between GMT and GMT+2),
  • The device itself (Adalo preview vs AVD simulator vs actual mobile phone).

Anyone having any pointers on how to master filtering on dates?

— EDIT —
I made a quick showcase app to reproduce the issue I’m facing - available here.

I created a Item collection with a Date property, added a few items with different dates (note: we are the 20/04 as I am writting this)

Then created 1 screen filtering on Today’s items:

Works as expected:

Created a 2nd screen, filtering on Tomorrow’s items this time:

Checking the preview, the items displayed are the ones for… today:

As I was saying, this result does not seem to be consistent and it behaved differently depending on the device, time of the test and even device’s timezone. Filtering on Tomorrow has sometimes shown items for Today (as above), for Tomorrow (as it should be) or sometimes for 2 days from now (?!).

— /EDIT —

Thanks :slight_smile:
Tide

Hi @tide ,

My experience is not as intense as you are, but for my case, I use only current time and start of the day, the other options I don’t use.

You can convert them to number and doing manipulation by adding or substracting, for date it is just integer (not fraction), plus 1, it means plus 1 day.

For time, you need to multiply by 24x60 = 1440 minutes

Hope with this you can see others doing with it.

Hey @Yongki,

Thanks a lot for replying! :slight_smile:
Following what you said, how would you compare a date property to Today? Do you compare it to int(current time)?

Cheers,
Tide

For comparing today, you can use date property is between start of today and start of today + 1.

For time, check this post.

also this one,

It might give you some clarification.

Thanks @Yongki.
Filtering on today is working fine with the “Current time” filter, but Tomorrow is not. Even tried with “date property is between” as you suggested :frowning:

I’ve done some extensive digging around the date & time problem and there appears to be a bug related to timezones. I’ve sent through my findings to the dev team internally. I imagine, but make no promises, that this will be addressed relatively quickly by the engineers.

3 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.