From fc60a2e1284dcc9c2aea22e28c084975a6149636 Mon Sep 17 00:00:00 2001 From: Andre Coullard Date: Wed, 6 May 2026 23:43:38 -0400 Subject: [PATCH 1/2] allow date to be nullable on billHistory items --- components/bill/HistoryTable.tsx | 4 +++- components/bill/Status.tsx | 10 ++-------- functions/src/bills/types.ts | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/components/bill/HistoryTable.tsx b/components/bill/HistoryTable.tsx index 04335eebf..1f832c786 100644 --- a/components/bill/HistoryTable.tsx +++ b/components/bill/HistoryTable.tsx @@ -37,7 +37,9 @@ const BillHistoryActionRows = ({ billHistory }: HistoryProps) => { return ( - {Date.substring(5, 10)}-{Date.substring(0, 4)} + {Date + ? `${Date.substring(5, 10)}-${Date.substring(0, 4)}` + : ""} diff --git a/components/bill/Status.tsx b/components/bill/Status.tsx index 42226395f..317541838 100644 --- a/components/bill/Status.tsx +++ b/components/bill/Status.tsx @@ -38,14 +38,8 @@ export const Status = ({ bill }: BillProps) => { hearingCheck = true } - let hearingDate = "" - if (history?.Date) { - hearingDate = history.Date - } - let dateCheck = false - if (hearingDate < today) { - dateCheck = true - } + const hearingDate = history?.Date ?? "" + const dateCheck = !!hearingDate && hearingDate < today if (!history) return null return ( diff --git a/functions/src/bills/types.ts b/functions/src/bills/types.ts index 33b5420f8..c75e8787a 100644 --- a/functions/src/bills/types.ts +++ b/functions/src/bills/types.ts @@ -19,7 +19,7 @@ export const BillReference = Record({ export type BillHistoryAction = Static export const BillHistoryAction = Record({ - Date: String, + Date: Nullable(String), Branch: String, Action: String }) From bea930c96a5d00cdb801bad6f33d09e319e67f56 Mon Sep 17 00:00:00 2001 From: Andre Coullard Date: Thu, 7 May 2026 01:44:58 -0400 Subject: [PATCH 2/2] formatting --- components/bill/HistoryTable.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/bill/HistoryTable.tsx b/components/bill/HistoryTable.tsx index 1f832c786..ad5445242 100644 --- a/components/bill/HistoryTable.tsx +++ b/components/bill/HistoryTable.tsx @@ -37,9 +37,7 @@ const BillHistoryActionRows = ({ billHistory }: HistoryProps) => { return ( - {Date - ? `${Date.substring(5, 10)}-${Date.substring(0, 4)}` - : ""} + {Date ? `${Date.substring(5, 10)}-${Date.substring(0, 4)}` : ""}