Datarable - Multiple date filter issue

UI Components for React
Post Reply
maxmeloni
Posts: 1
Joined: 06 Jun 2022, 21:29

16 Jun 2023, 15:24

Hi,

I'm adding a filtering function to a date column of datatable. The filter is initialized this way:

createdDate: { operator: FilterOperator.AND, constraints: [{ value: null, matchMode: FilterMatchMode.DATE_IS }] },

The small filter window is working properly with only 1 search rule, but if I add another rule then it starts to behave weirdly:
  • when I click on the second date input field, I get the calendar popup for date selection, but my selection is copied to the first date input field too (so they both will have the same date input)
  • if I run the filtering function, and then I click back to filter icon to review the filter, the second date input field is empty
I have also attached a custom filter function to run the filters. This is the object passed to it, you can see the second date search term value is missing (it's null):

Code: Select all

{
    "first": 0,
    "rows": 50,
    "sortField": null,
    "sortOrder": null,
    "multiSortMeta": [],
    "filters": {
        "createdDate": {
            "operator": "and",
            "constraints": [
                {
                    "value": "2023-06-21T22:00:00.000Z",
                    "matchMode": "dateIsNot"
                },
                {
                    "value": null,
                    "matchMode": "dateIsNot"
                }
            ]
        }
    }
}
Please note that this issue appears on every kind of filter (so it is not related to Calendar or date types).


Thank you,

Max

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: Ernestoitamn and 18 guests