From 0c563fc28fefa0cd7181fd78c579c3a86faaa4f9 Mon Sep 17 00:00:00 2001 From: Nate Sesti <33237525+sestinj@users.noreply.github.com> Date: Wed, 23 Aug 2023 14:44:33 -0700 Subject: Testing gh workflow (#401) * testing * logging again * log home dir * build m1 script * correctly parse dates in history.tsx * logging * add redbaron to requirements.txt * tweaks before merging to main --- extension/react-app/src/pages/history.tsx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'extension/react-app') diff --git a/extension/react-app/src/pages/history.tsx b/extension/react-app/src/pages/history.tsx index edf4d39f..2eb895b1 100644 --- a/extension/react-app/src/pages/history.tsx +++ b/extension/react-app/src/pages/history.tsx @@ -14,6 +14,14 @@ const Tr = styled.tr` } `; +const parseDate = (date: string): Date => { + let dateObj = new Date(date); + if (isNaN(dateObj.getTime())) { + dateObj = new Date(parseInt(date) * 1000); + } + return dateObj; +}; + const TdDiv = styled.div` cursor: pointer; padding-left: 1rem; @@ -46,6 +54,8 @@ function History() { fetchSessions(); }, [client]); + console.log(sessions.map((session) => session.date_created)); + return (
@@ -72,9 +86,7 @@ function History() {
>
{session.title}
- {new Date(
- parseInt(session.date_created) * 1000
- ).toLocaleString("en-US", {
+ {parseDate(session.date_created).toLocaleString("en-US", {
weekday: "short",
year: "numeric",
month: "long",
--
cgit v1.2.3-70-g09d2
|