Fixed arrival processing
This commit is contained in:
@@ -52,22 +52,12 @@ const CLASS_ORDER: Record<string, number> = {
|
||||
}
|
||||
|
||||
const customKeySort = {
|
||||
class_seat_combined: (a: Flight['flight_class'], b: Flight['flight_class']) => {
|
||||
return (CLASS_ORDER[a?.name ?? ''] ?? -1) - (CLASS_ORDER[b?.name ?? ''] ?? -1)
|
||||
},
|
||||
airline: (a: Flight['airline'], b: Flight['airline']) => {
|
||||
return (a?.iata_code ?? '').localeCompare(b?.iata_code ?? '')
|
||||
},
|
||||
aircraft: (a: Flight['aircraft'], b: Flight['aircraft']) => {
|
||||
return (a?.designator ?? '').localeCompare(b?.designator ?? '')
|
||||
},
|
||||
class_seat_combined: (a: Flight['flight_class'], b: Flight['flight_class']) => (CLASS_ORDER[a?.name ?? ''] ?? -1) - (CLASS_ORDER[b?.name ?? ''] ?? -1),
|
||||
airline: (a: Flight['airline'], b: Flight['airline']) => (a?.iata_code ?? '').localeCompare(b?.iata_code ?? ''),
|
||||
aircraft: (a: Flight['aircraft'], b: Flight['aircraft']) => (a?.designator ?? '').localeCompare(b?.designator ?? ''),
|
||||
duration: (a: any, b: any) => (a ?? 0) - (b ?? 0),
|
||||
departure_airport: (a: Flight['departure_airport'], b: Flight['departure_airport']) => {
|
||||
return (a?.display_code ?? '').localeCompare(b?.display_code ?? '')
|
||||
},
|
||||
arrival_airport: (a: Flight['arrival_airport'], b: Flight['arrival_airport']) => {
|
||||
return (a?.display_code ?? '').localeCompare(b?.display_code ?? '')
|
||||
},
|
||||
departure_airport: (a: Flight['departure_airport'], b: Flight['departure_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? ''),
|
||||
arrival_airport: (a: Flight['arrival_airport'], b: Flight['arrival_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? '')
|
||||
}
|
||||
|
||||
const sortBy = ref<DataTableSortItem[]>([])
|
||||
|
||||
Reference in New Issue
Block a user