yadcf range_date does not filter anything

1.1k Views Asked by At

I am using the latest version to filter a date range. My data rows look like this:

<td>
<span>{{item.actionDTS | date: 'MM/dd/yyyy' }}</span>
</td>

The filter "from" and "to" works fine, but when I select the date it does not filter anything. My filter column is setup like this:

$("#tbl_Report").dataTable().yadcf([
                    {column_number: 0, filter_type: 'text'},
                    {
                        column_number: 1,
                        filter_type: 'range_date',
                        date_format: 'mm/dd/yyyy',
                        filter_container_id: "external_filter_container"
                    },
                  ....
                ]);

Any help is appreciated.

2

There are 2 best solutions below

1
On BEST ANSWER

Since you are holding your data wrapped inside html element you should use column_data_type in your yadcf setup so it looks like this:

{
    column_number: 1,
    filter_type: 'range_date',
    date_format: 'mm/dd/yyyy',
    column_data_type: html,
    filter_container_id: "external_filter_container"
}
0
On

I removed the span and it started to work. I hope this helps somebody.