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
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
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
Could you also use the date range filter instead? This will show a calendar field which makes it easier for users to select a date, and you don't have to do any queries from your data source.
Yep. Thx.
Thats what I wrote above in my reply to saurabhk469
But thx anyway, appreciate it