fixed get_date_range and past function