[SD-1178] fix the javascript error in related to facet filter

I'd broken the date facets with the introduction of the modification date filter.
This can be split in two: first filter the unneeded keys and then handle the rest of the logic.