From d4ad8d4a9fdc09c66ba8203c4cf2218496442d01 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Sat, 14 Nov 2020 10:03:30 -0500 Subject: add latest update date --- src/App.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/App.js') diff --git a/src/App.js b/src/App.js index 4abd1e4..74d97be 100644 --- a/src/App.js +++ b/src/App.js @@ -1,4 +1,5 @@ import useSWR from "swr"; +import { DateTime } from "luxon"; import Card from "./Card"; import "./App.css"; @@ -24,10 +25,13 @@ function App() { const latest = data[data.length - 1]; const prior = data[data.length - 2]; + const local = DateTime.local().zoneName; + const lastUpdate = DateTime.fromSQL(latest.last_updated, { zone: "UTC" }).setZone(local); return (

RIT Covid Dashboard

+

Last Updated: {lastUpdate.toLocaleString(DateTime.DATETIME_FULL)}

-- cgit v1.2.3