reconstructed get_dates and add_date_to_query after git checkout disaster