How to narrow down from 'dates/time' to just 'date' in a userFilter of a record

Hi,

I like to create a user filter for a "my travels"-record which enables a user to filter his  travels for a specific date, more exactly the 'day' within it and not the time.

I have created a queryRule as a basis which returns a list of dictionarys from the database with all the travel dates of the current user.
But it contains a date+time object which results to mutliple records for the same day, if they occured on different hours of the day. (ok let's assume this may be realisitc... :))

I cannot just cast to date() because it result in dateTime also.

Example:

List of Dictionary - 6 items

    • Dictionary
        • DatumAbreise2/3/2020 2:00 AM GMT+01:00(Date and Time)
      • Dictionary
          • DatumAbreise9/13/2020 1:00 AM GMT+02:00(Date and Time)
          • Dictionary
              • DatumAbreise9/13/2020 2:00 AM GMT+02:00(Date and Time)
              • Dictionary
                  • DatumAbreise9/13/2020 3:00 AM GMT+02:00(Date and Time)
                  • Dictionary
                      • DatumAbreise9/13/2020 4:00 AM GMT+02:00(Date and Time)
                      • Dictionary
                          • DatumAbreise9/14/2020 2:30 AM GMT+02:00(Date and Time)

                          As can be seen, the result contains four travels at the 13th of september at 1, 2, 3, and 4 o'clock.

                          This results in a userFilter Option of 6 items and forces the user to select them all, in order to display all travels on the 13th of september.
                          I can change the !recordFilterListOption( ) 'name' setting to just the date and not the time resulting in the following picture, but this does not really help.

                          It is not what I want. I want only one entry per day and only the day, not the time.

                          But if I manipulte the list of selection options and purge  and change it down to something like this:

                          List of Text String - 10 items

                            • "03.02.2020"(Text)
                                • "13.09.2020"(Text)
                                  • "14.09.2020"(Text)

                                    It does not sit well with the selection of the recordFilter().
                                    The filter on the record won't work, because it expects a dateTime and and not a text and there is a missmatch beween the options I provide after my manipulation  and the result from the databse.

                                    How can I set the filter to offer distinct values of dates (and no times) and filter the data consequently with all travels between the 24 h hours of that day?

                                    Thx for your ideas.

                                      Discussion posts and replies are publicly visible

                                    Parents Reply Children
                                    No Data