Best way to remove parts of filters

Id like to remove the hours and minutes part of the search filter bar for dateTime querries so our users only have to think about the date. How do I turn off that part of the display?

Setting up a default value for (only) the following situation would be needed as well

Created At > date (00:00) && Created At < date (23.59)

I’d appreciate just being pointed in the right direction so I can figure the rest out on my own.

Hi,
You do a search only by date using the filter custom condition and JPQL query macros ([url=]https://doc.cuba-platform.com/manual-6.2/jpql_macro.html[/url]).
Click ‘Add search condition’ link on filter panel, then select ‘Create new…’ item in the bottom of the list - a custom condition dialog will be opened.
Then enter the ‘Where’ value: @dateEquals({E}.createTs, ?) and select the ‘Param type’: Date (see the screenshot).

create_ts_macros

This is helpful and works well, but I need to prod further.

The users have asked for a specific thing, and I can’t figure out how to give it to them.
They would like to have a default filter that gives them two calanders, one for entering the (included) starting date, and one for entering the (included) ending date so they can view all applications within that frame. They don’t want to see any hours or minutes. The problem is that they want this coded into the screen so they don’t have to create the filter themselves.
I have attempted using Cuba Studio to create the custom filter as well as trying to create the desired custom query in the xml with no successes. How do I accomplish this?

Hi Ned,
Please see the project attached. It demonstrates two approaches.
The first one is using filter custom conditions. The disadvantage of this approach is that you cannot define the condition “less or equals including the date”. You will have to select the next day value.
The second approach is to use a custom filter - it is a panel that is added to the browser screen and has a hard-coded set of fields and filter apply behavior. This filter is not generic but you can implement anything you want.
And besides, there is always the third approach. You can create a new field in your entity that will be of the Date (without time) datatype. In the entity listener when the datatime field is updated, you will write a truncated date value to this field. Then you will be able to use this field in the generic filter.

filter-test.zip (26.7K)