How to configure searchBuilder to work with dates?

How to configure searchBuilder to work with dates?

cchintall83cchintall83 Posts: 36Questions: 11Answers: 0

Link to test case: https://codepen.io/jchintall2019/pen/ExQwOyd
Debugger code (debug.datatables.net): none
Error messages shown: none
Description of problem: When using the Custom Search Builder for dates, the result is either "no records found" or no change to the HTML table. The date (s) to be located are not found. For example, if the search builder conditions are setup to find dates before 4/12/2019, no results are found or the table remains the same as before the search was initiated. Upon using the general search tool searching with any part of the date, month, day or year these requests are found and listed. For example, enter in the search area 20, the results are all dates with "20" included in the date format.
What changes are needed for searchBuilder to work for dates?

Thanks for any help!

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    edited May 2022

    These examples, here and here, show how to format dates with Moment and Luxon.

    If it's not working for you, I suspect the issue is the format coming back from the server isn't the same as that expected by SearchBuilder . If no joy, can you post a few records that the server would send, please.

    Colin

Sign In or Register to comment.