fixes available date filtering by trading ruby filtering for sql filtering