From 8a271fdcf8f051544b30e099e9db550386a5f981 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 10 Mar 2023 16:10:32 +0100 Subject: [PATCH] nothing special --- storage/vehicles.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/storage/vehicles.go b/storage/vehicles.go index e4da167..0b8b8a7 100644 --- a/storage/vehicles.go +++ b/storage/vehicles.go @@ -25,8 +25,6 @@ type VehicleFilters struct { func (v Vehicle) Free(start time.Time, end time.Time) bool { for _, b := range v.Bookings { - fmt.Println("Bookings for", v) - fmt.Println(b) if ((start.Before(b.Unavailablefrom) || start.Equal(b.Unavailablefrom)) && (end.After(b.Unavailablefrom.Add(24*time.Hour)) || end.Equal(b.Unavailablefrom.Add(24*time.Hour)))) || ((start.Before(b.Unavailableto) || start.Equal(b.Unavailableto)) && (end.After(b.Unavailableto.Add(24*time.Hour)) || end.Equal(b.Unavailableto.Add(24*time.Hour)))) || ((start.After(b.Unavailablefrom) || start.Equal(b.Unavailablefrom)) && (end.Before(b.Unavailableto.Add(24*time.Hour)) || end.Equal(b.Unavailableto.Add(24*time.Hour)))) { @@ -37,6 +35,8 @@ func (v Vehicle) Free(start time.Time, end time.Time) bool { } func (v Vehicle) MatchesFilters(filters VehicleFilters) bool { + fmt.Println("Filters : ", filters) + if len(filters.Types) > 0 { found := false for _, t := range filters.Types { @@ -69,7 +69,5 @@ func (v Vehicle) MatchesFilters(filters VehicleFilters) bool { return false } - fmt.Println(filters) - return true }