diff options
author | Galen Guyer <galen@galenguyer.com> | 2020-11-14 10:03:30 -0500 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2020-11-14 10:03:30 -0500 |
commit | d4ad8d4a9fdc09c66ba8203c4cf2218496442d01 (patch) | |
tree | 29380af7b5f296a372215773610971c13830154f /src/App.js | |
parent | 01e9ba26136c351793f41c99e85f3caddfca8c81 (diff) |
add latest update date
Diffstat (limited to 'src/App.js')
-rw-r--r-- | src/App.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 ( <div className="App"> <h1>RIT Covid Dashboard</h1> + <h3>Last Updated: {lastUpdate.toLocaleString(DateTime.DATETIME_FULL)}</h3> <div className="Section"> <Card name="Total Student Cases" latest={latest.total_students} prior={prior.total_students} /> <Card name="Total Staff Cases" latest={latest.total_staff} prior={prior.total_staff} /> |