Add more airlines and fix edit bugs
This commit is contained in:
@@ -2,24 +2,20 @@
|
||||
import { computed } from "vue";
|
||||
import { Flight } from "@/Types/types";
|
||||
import BoardingPass from "@/Components/FlightsGoneBy/BoardingPass.vue";
|
||||
import { FlightStats } from "@/Composables/useFlightStats";
|
||||
|
||||
const props = defineProps<{
|
||||
flights: Flight[]
|
||||
flightStats: FlightStats
|
||||
canEdit: boolean
|
||||
}>()
|
||||
|
||||
const today = new Date()
|
||||
today.setHours(0, 0, 0, 0)
|
||||
|
||||
const upcomingFlights = computed(() =>
|
||||
props.flights
|
||||
.filter(f => new Date(f.departure_date) >= today)
|
||||
[...props.flightStats.upcomingFlights.value]
|
||||
.sort((a, b) => new Date(a.departure_date).getTime() - new Date(b.departure_date).getTime())
|
||||
)
|
||||
|
||||
const departedFlights = computed(() =>
|
||||
props.flights
|
||||
.filter(f => new Date(f.departure_date) < today)
|
||||
[...props.flightStats.pastFlights.value]
|
||||
.sort((a, b) => new Date(b.departure_date).getTime() - new Date(a.departure_date).getTime())
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user