Skip to content

Commit

Permalink
🐛 yellowstone date filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
juftin authored Dec 4, 2024
1 parent ba4f250 commit 60d3223
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion camply/search/search_yellowstone.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ def get_all_campsites(self) -> List[AvailableCampsite]:
)
campsite_df = self.campsites_to_df(campsites=matching_campsites)
campsite_df_validated = self._filter_date_overlap(campsites=campsite_df)
time_window_start = min(self.search_days)
time_window_end = max(self.search_days) + timedelta(days=1)
compiled_campsite_df = campsite_df_validated[
campsite_df_validated.booking_end_date <= pd.Timestamp(time_window_end)
(campsite_df_validated.booking_date >= pd.Timestamp(time_window_start))
& (campsite_df_validated.booking_end_date <= pd.Timestamp(time_window_end))
]
compiled_campsites = self.df_to_campsites(campsite_df=compiled_campsite_df)
return compiled_campsites
Expand Down

0 comments on commit 60d3223

Please sign in to comment.