Aravind
Aravind

Reputation: 1401

Unable to apply date range filter for datatables

I am using the YADCF plugin for datatables to use filters for columns. I am using the following code to implement YADCF with datatables

$('#custom_order_admin').dataTable({

    "bJQueryUI": true,
    "sPaginationType": "full_numbers",
    "sDom": '<"H"Tfr>t<"F"ip>',
    "oTableTools": {
        "sSwfPath": "/swf/copy_csv_xls_pdf.swf",
        "aButtons": [
            {
                "sExtends":    "csv",
                "sButtonText": "CSV",
                "mColumns": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
            },
            {
                "sExtends":    "pdf",
                "sButtonText": "PDF",
                "mColumns": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
            },
            {
                "sExtends":    "xls",
                "sButtonText": "XLS",
                "mColumns": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
            },
            {
                "sExtends":    "copy",
                "sButtonText": "Copy",
                "mColumns": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
            }
        ]
    },
    "aaSorting": []
}).yadcf([{
    column_number: 0,
    filter_type: "range_date",
    date_format: "dd/mm/yyyy"
}
]);

I am getting the date range filter in the UI(i.e the two boxes to select dates) but when I change the date nothing happens. I have dates in dd/mm/yyyy format so I changed the date format to dd/mm/yyyy as prescribed in the comment of the js file but it also has not changed. Other filters seem to work fine. Any idea why?

Upvotes: 1

Views: 1891

Answers (1)

Aravind
Aravind

Reputation: 1401

I was using bootstrap-date picker also in the same application so there was conflict. When I removed it. I was able to solve this issue.

Upvotes: 1

Related Questions