Can I use 2 dates in datatables search field for multiple keyword search?
Can I use 2 dates in datatables search field for multiple keyword search?

Good night,
I have been trying to find a way to make datatables search field bring up records based on multiple keywords. I found where someone else had the same problem as me and they used this site: https://datatables.net/reference/api/search() using regex.
I created the regular expression to bring up records based on 2 names as keywords and 2 dates as keywords. The names work fine but when I try to use dates as the keyword I get this message:No matching records found.
dt_history = $('#historytbl').DataTable({
destroy: true,
search: {regex: true},
searchHighlight: true
});
$('.form-control .form-control-sm').on('keyup', function(){
var pattern ="/^[A-Za-z] | [A-Za-z] | [0-9]{4}-[0-9]{2}-[0-9]{2} | [0-9]{4}-[0-9]{2}-[0-9]{2}$/";
dt_history.column([0,2]).search(pattern, true, false).draw();
});
This discussion has been closed.
Answers
Hi @dt_user ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Are you looking for a range search? If so see this example:
https://datatables.net/examples/plug-ins/range_filtering.html
In order to help we will need to understand what your data looks like. Please post a link to your page or a test case replicating the problem. This way we can see your table and have a better understanding of what you are doing.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin