Reserva Online

Cookies

Utilizamos cookies propias y de terceros para mejorar nuestros servicios.

Categories

  • Turismo
  • Tourism
  • Outdoors
  • Nature
  • Car tour
Show
per page (Total: 4)
document.addEventListener("DOMContentLoaded", function() { const calendarElement = document.getElementById('calendar'); const availableDatesElement = document.getElementById('available-dates'); const availableDates = [ '2024-06-10', '2024-06-15', '2024-06-20', '2024-06-25' ]; function renderCalendar() { const currentDate = new Date(); const currentMonth = currentDate.getMonth(); const currentYear = currentDate.getFullYear(); const daysInMonth = new Date(currentYear, currentMonth + 1, 0).getDate(); for (let day = 1; day <= daysInMonth; day++) { const dayElement = document.createElement('div'); dayElement.classList.add('day'); const dateString = `${currentYear}-${String(currentMonth + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`; dayElement.textContent = day; if (availableDates.includes(dateString)) { dayElement.classList.add('available'); dayElement.addEventListener('click', () => { alert(`Fecha disponible: ${dateString}`); }); } else { dayElement.classList.add('unavailable'); } calendarElement.appendChild(dayElement); } } renderCalendar(); });