Skip to content

Commit

Permalink
Fix error when multiple filters applied
Browse files Browse the repository at this point in the history
  • Loading branch information
andreynovikov committed Dec 25, 2018
1 parent 23c7e7c commit 00b88b8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktr
$('input#drp-{{ field_name }}').closest('li').addClass("selected");
$('input#drp-{{ field_name }}').on('apply.daterangepicker', function(ev, picker) {
$(this).val(picker.startDate.format('YYYY.MM.DD') + ' - ' + picker.endDate.format('YYYY.MM.DD'));
window.location = window.location.pathname + '{{ choices.0.query_string }}' +
window.location = window.location.pathname + '{{ choices.0.query_string|safe }}' +
'&{{ field_name }}__gte=' + picker.startDate.format('YYYY-MM-DD') +
'&{{ field_name }}__lte=' + picker.endDate.format('YYYY-MM-DD')
});
Expand All @@ -46,12 +46,12 @@ <h3>{% blocktrans with filter_title=title %} By {{ filter_title }} {% endblocktr
if (range !== "") {
var vals = range.split(/\s?-\s?/);
if (vals.length == 2) {
window.location = window.location.pathname + '{{ choices.0.query_string }}' +
window.location = window.location.pathname + '{{ choices.0.query_string|safe }}' +
'&{{ field_name }}__gte=' + vals[0].replace(/\./g, '-') +
'&{{ field_name }}__lte=' + vals[1].replace(/\./g, '-')
}
} else {
window.location = window.location.pathname + '{{ choices.0.query_string }}'
window.location = window.location.pathname + '{{ choices.0.query_string|safe }}'
}
});
});
Expand Down

0 comments on commit 00b88b8

Please sign in to comment.