Fix time range filtering