Fix for #1311

Logic of date filters had been mixed-up
I'm still trying to get my head around it and it just looks like the test itself is broken.

Perhaps add a comment about why this behaviour is expected then?