From fd6f6f169f9ff9a1247228fb34dc9654a9584915 Mon Sep 17 00:00:00 2001
From: Zach Berwaldt <zberwaldt@tutamail.com>
Date: Thu, 21 Mar 2024 11:23:42 -0400
Subject: fix bugs, redo layout, reorg.

---
 fe/src/lib/Table.svelte | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'fe/src/lib/Table.svelte')

diff --git a/fe/src/lib/Table.svelte b/fe/src/lib/Table.svelte
index 621157e..3ce3331 100644
--- a/fe/src/lib/Table.svelte
+++ b/fe/src/lib/Table.svelte
@@ -7,7 +7,7 @@
 
     export let sortBy: string = 'date';
 
-    type SortComparator = (a, b) => number
+    type SortComparator = (a:any , b:any) => number
 
     function getDataKeys(data: any[]): string[] {
         if (!data || data.length === 0) return [];
@@ -20,7 +20,7 @@
         return Object.entries(row).filter((r) => !omit.includes(r[0]));
     }
 
-    function sort(arr: Array<Record<string, any>>, fn: SortComparator = (a , b) => new Date(b[sortBy]) - new Date(a[sortBy])) {
+    function sort(arr: Array<Record<string, any>>, fn: SortComparator = (a , b) => Date.parse(b[sortBy]) - Date.parse(a[sortBy])) {
         return arr.sort(fn)
     }
 
@@ -92,10 +92,7 @@
         border: solid 1px black;
         border-collapse: collapse;
         overflow-y: hidden;
-    }
-
-    th {
-        text-transform: capitalize;
+        width: calc(100% - 16px);
     }
 
     thead tr {
@@ -108,6 +105,7 @@
 
     th,
     td {
+        text-transform: capitalize;
         padding: 1em;
         border: 1px solid rgba(0, 0, 0, 1);
     }
-- 
cgit v1.1

