Initial commit: Vuelato - buscador de vuelos
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
Nuxt 4 + Supabase + Flightics API. Incluye búsqueda de vuelos, inspiraciones, watchlist, tracking de precios y mapa interactivo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
app/components/search/DateRangePicker.vue
Normal file
27
app/components/search/DateRangePicker.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
const dateFrom = defineModel<string>('dateFrom', { default: '' })
|
||||
const dateTo = defineModel<string>('dateTo', { default: '' })
|
||||
|
||||
defineProps<{
|
||||
singleDate?: boolean
|
||||
}>()
|
||||
|
||||
const today = new Date().toISOString().slice(0, 10)
|
||||
|
||||
watch(dateFrom, (from) => {
|
||||
if (from && dateTo.value && dateTo.value < from) {
|
||||
dateTo.value = from
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<UFormField :label="singleDate ? 'Fecha' : 'Desde'">
|
||||
<UInput v-model="dateFrom" type="date" :min="today" :max="dateTo || undefined" required />
|
||||
</UFormField>
|
||||
<UFormField v-if="!singleDate" label="Hasta">
|
||||
<UInput v-model="dateTo" type="date" :min="dateFrom || today" required />
|
||||
</UFormField>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user