Changed types

This commit is contained in:
2025-09-12 19:40:53 +02:00
parent af1bf82c75
commit 0fe16ad79e
12 changed files with 35 additions and 11 deletions

View File

@@ -7,7 +7,7 @@
*/
export function sortData<T extends Record<string, any>>(
data: T[],
column?: keyof T,
column?: keyof T | null,
ascending: boolean = true
): T[] {
if (!column) return data
@@ -27,6 +27,7 @@ export function sortData<T extends Record<string, any>>(
}
// Datumsvergleich
// @ts-ignore
if (valA instanceof Date && valB instanceof Date) {
return ascending ? valA.getTime() - valB.getTime() : valB.getTime() - valA.getTime()
}