cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CAP project MDC table filterfield DATE search

lumencloud
Discoverer
253

Hello,
I apologize for my lack of proficiency in English.

I am currently working on implementing a feature in CAP development where the MDC Table uses a FilterField with odata.type.Date as the dataType to search dates using a DynamicDateRange.

Currently, range searches like BT (Between) work fine, but searches for specific dates, such as "EQ," "Yesterday," or "Tomorrow," are not working.

I am using an OData V4 query in the controller to get data and bind it to a JSONModel.
Additionally, I am using HANA DB, and the type of the cDate column is DateTime.
The data is stored in ISO format (e.g., 2025-01-22T12:27:06Z).
I have tried changing the type to DateTime in both the view and propertyInfo, but the results remain the same.

Here is the code attached.

{
            key: "cDate",
            label: "Date",
            visible: true,
            path: "cDate",
            dataType: "sap.ui.model.odata.type.Date",
            formatOptions : {
                pattern : "yyyy.MM.dd"
            }
        }

1. part of ProPertyInfo.js 
 <mdc:FilterField
                            id="dateFilter"
                            conditions="{$filters>/conditions/cDate}"
                            label="{i18n>date}"
                            propertyKey="cDate"
                            dataType="sap.ui.model.odata.type.Date"
                            delegate="{name: 'bulletinboardui/delegate/FieldBaseDelegate', payload: {}}"
                            maxConditions="1"
                            operators="EQ,BT,TODAYFROMTO,LASTDAYS,TODAY"
                            change="onPressDateFilter"
                            dataTypeFormatOptions="{pattern : 'yyyy.MM.dd'}"
                        />

2. Part of view.xml

I would appreciate your advice on resolving this issue.
Thank you

Accepted Solutions (0)

Answers (0)