added from date range functionality and fixed tests