Cannot use Date Filter in Searchbuilder
Cannot use Date Filter in Searchbuilder
poeziafree
Posts: 35Questions: 11Answers: 0
I have just started using the SearchBuilder. Before that, I was using Moment.js (https://cdn.jsdelivr.net/momentjs/latest/moment.min.js) and DateTime Moment (https://cdn.datatables.net/plug-ins/1.10.24/sorting/datetime-moment.js).
When using the Searchbuilder for dates, I am getting the following error: Uncaught TypeError: t is not a function.
Is any solution available?
My code:
Link to test case: https://jsfiddle.net/jL7pt01w/1/
Answers
Hi @poeziafree ,
Thanks for the test case. If you change the order of your script tags so that moment is included before SearchBuilder the filtering seems to work ok. See my changes to your example.
The is still however an error being thrown with the SearchHighlight plugin. There is an issue for this (DD-2030 for my reference) I'll report back here when there is an update.
Thanks,
Sandy
Hi, @sandy,
Thank you for your comment. Could you please specify what do you mean by 'DD-2030 for my reference'?
So, do you believe that the error is not thrown from my code? In the meantime, what can I use as an alternative so that I can make use of the SearchBuilder?
Thanks
Hi @poeziafree ,
DD-2030 is simply the internal bug number that we use to track the issue. You don't need to worry about that - it's just so that I can find the original post in the future.
The error with SearchBuilder was cause due to the order in which you had your script tags. You can see the order that works by comparing the test cases above.
The updated example I provided shows SearchBuilder is working fine, it is the SearchHighlight plugin that is causing the error. You could remove that and it would remove the error. Either way, SearchBuilder will still work.
Thanks,
Sandy