Search builder "greater than" search ability?
Search builder "greater than" search ability?
vsek
Posts: 30Questions: 17Answers: 0
Hey All, Love search builder. One of my columns happens to be a date/time column. Is it possible to do a < or > type search somehow? Or configure it accordingly?
This discussion has been closed.
Answers
I tried this example and it seems to work:
Kevin
If you're not seeing that with your data, it would suggest that the date isn't being recognised as a date, and is defaulting to a string - so check your values and ensure they're all formatted correctly.
Colin
ok, thanks. I might need to a conversion. I bet its coming back as a string instead of a date field
I wonder if the technique described in this date sorting blog will help to set the type properly for the SearchBuilder to pickup.
Kevin
ok question. Below is how I have my columns initialized. Pretty simple. Can I simply format the <TH> to a date/time format or would this all need to be done inside Datatable settings somehow?
<
div class="standard-table">
<
table class="display" id="standard_datatable">
<thead>
<tr>
<th>Load Status</th>
<th >Start Time</th>
<th>Load Duration(Seconds)</th>
<th>Sender Identifier</th>
<th>Feed Name</th>
<th>File Name</th>
<th>Message Action</th>
<th>Audit/Load</th>
<th>Warnings</th>
<th>Errors</th>
<th>Total</th>
Did you look at the date sorting blog I linked?
I used the technique described and it works.
http://live.datatables.net/kizofawu/1/edit
This line is commented out:
Try searching by the Start date and you will see the conditions listed won't have options like
After
. Uncomment that, which matches the date format in the table, re-run the script and you will see range options.You will need to use the moment format that matches your date format.
Kevin
sweet, thanks