Download script.js from swatinegi21/skyscout-cheap-flight-finder: direct link, hf CLI and curl.
- Browser
- Download file 967 Bytes
-
https://huggingface.co/spaces/swatinegi21/skyscout-cheap-flight-finder/resolve/main/script.js
- Command line
-
hf download hf://spaces/swatinegi21/skyscout-cheap-flight-finder/script.js
-
curl -L -o script.js https://huggingface.co/spaces/swatinegi21/skyscout-cheap-flight-finder/resolve/main/script.js
967 Bytes
| // Initialize date pickers and other global functionality | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize date pickers | |
| const departureDateInput = document.getElementById('departure-date'); | |
| const returnDateInput = document.getElementById('return-date'); | |
| if (departureDateInput) { | |
| departureDateInput.valueAsDate = new Date(); | |
| // Set return date to 7 days after departure | |
| const returnDate = new Date(); | |
| returnDate.setDate(returnDate.getDate() + 7); | |
| returnDateInput.valueAsDate = returnDate; | |
| } | |
| // Mobile menu toggle functionality will be handled in the navbar component | |
| }); | |
| // Flight search form submission | |
| function handleFlightSearch(event) { | |
| event.preventDefault(); | |
| // In a real app, this would submit to a backend or API | |
| console.log('Searching for flights...'); | |
| alert('Search functionality would be implemented here in a real application.'); | |
| } |