Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/bill/HistoryTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const BillHistoryActionRows = ({ billHistory }: HistoryProps) => {
return (
<tr key={index}>
<td>
{Date.substring(5, 10)}-{Date.substring(0, 4)}
{Date ? `${Date.substring(5, 10)}-${Date.substring(0, 4)}` : ""}
</td>
<td>
<LinkConnectedBills action={Action} />
Expand Down
10 changes: 2 additions & 8 deletions components/bill/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion functions/src/bills/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const BillReference = Record({

export type BillHistoryAction = Static<typeof BillHistoryAction>
export const BillHistoryAction = Record({
Date: String,
Date: Nullable(String),
Branch: String,
Action: String
})
Expand Down
Loading