From 0b1a987e4112c362c1f82aa42bd3058d845fd6f2 Mon Sep 17 00:00:00 2001 From: Kenneth Jannette Date: Tue, 12 Mar 2024 20:24:41 -0500 Subject: [PATCH] more --- src/pageElements/Cards.js | 26 ++++++++++++++++++-------- src/styles/cards.scss | 16 +++++++++++----- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/pageElements/Cards.js b/src/pageElements/Cards.js index 0f83ba0..68b7bd0 100644 --- a/src/pageElements/Cards.js +++ b/src/pageElements/Cards.js @@ -278,10 +278,18 @@ export const DocCard = (props) => { const createdAtTime = createdAt?.seconds ? createdAt?.seconds : new Date().getTime(); + const now = new Date().getTime(); const uploadedAt = new Date(createdAtTime * 1000); const isReportable = Math.round((now - uploadedAt) / 60 / 1000) > 15; + function convertDate(dateVar) { + const date = new Date(parseInt(dateVar?.seconds) * 1000); + const date2 = date.toLocaleString("en-US", { month: "long" }); + const temp = String(date).split(" "); + return `${date2} ${temp[2]}, ${temp[3]}`; + } + const disabled = docType ? false : true; const tooltipText = "Parsing is taking a bit longer than usual. This usually resolves within 15 minutes. If it does not, click “report” and support will address the issue within 24 hours."; @@ -293,8 +301,8 @@ export const DocCard = (props) => { const documentTitle = docType === "interrogatories-out" - ? "Outbound requests" - : "Discovery responses"; + ? "Outbound request" + : "Discovery response"; const isOutbound = docType === "interrogatories-out"; const buttonText = @@ -315,14 +323,16 @@ export const DocCard = (props) => { <> )} - {dateServed ? ( -
Served: {dateServed}
- ) : ( - <> - )}
{parentCaseName}
+ {createdAt ? ( +
+ Created: {convertDate(createdAt)} +
+ ) : ( + <> + )} {disabled && isReportable ? (