| @@ -189,8 +189,18 @@ | ||
| 189 | 189 | $filters['duration'] = $preset; |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | + // Availability date: keep only a valid Y-m-d calendar date. Trips are | |
| 194 | + // then filtered to those with a departure on that date (see | |
| 195 | + // TripRepository::findWithFilters). | |
| 196 | + if (!empty($params['available_date']) && is_string($params['available_date'])) { | |
| 197 | + $date = \Yatra\Helpers\TripListingFilterBuilder::normalizeAvailableDate($params['available_date']); | |
| 198 | + if ($date !== '') { | |
| 199 | + $filters['available_date'] = $date; | |
| 200 | + } | |
| 201 | + } | |
| 202 | + | |
| 193 | 203 | // Horizontal search "budget" presets (min-max or min+) → price range when explicit prices not set |
| 194 | 204 | if ( |
| 195 | 205 | empty($filters['price_min']) && empty($filters['price_max']) |
| 196 | 206 | && !empty($params['budget']) && is_string($params['budget']) |