fix date in route query based on previous date