Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
Save Save datepicker range in datatable

i'm using datatable with date range filter by using datepicker. When i set stateSave: true

it saves all values except the range set into the input datepicker field. Any help on this?

Have a look here: http://live.datatables.net/kajabeli/2/edit

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

DataTables has documented custom filters https://datatables.net/examples/plug-ins/range_filtering.html

That will filters age (similiar cases with yours)

$.fn.dataTable.ext.search.push(
    function( settings, data, dataIndex ) {
        var start_date = Date.parse($('#start_date').val()) / 1000 || 0;
        var end_date = Date.parse($('#end_date').val()) / 1000 || 0;
        var value = Date.parse(data[5]) / 1000 || 0;
        /* put your filter conditions here,  */
        if ( ( start_date && end_date ) ||
            ( start_date && value <= end_date ) ||
            ( start_date <= value && end_date ) ||
            ( start_date <= value && value <= end_date ) )
        {
            return true;
        }
        return false;
    }
);

Add below codes after your dataTable initiation.

$('#start_date, #start_date').change( function() {
    table.draw();
} );
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!