aboutsummaryrefslogtreecommitdiff
path: root/src/App.js
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2020-11-14 10:03:30 -0500
committerGalen Guyer <galen@galenguyer.com>2020-11-14 10:03:30 -0500
commitd4ad8d4a9fdc09c66ba8203c4cf2218496442d01 (patch)
tree29380af7b5f296a372215773610971c13830154f /src/App.js
parent01e9ba26136c351793f41c99e85f3caddfca8c81 (diff)
add latest update date
Diffstat (limited to 'src/App.js')
-rw-r--r--src/App.js4
1 files changed, 4 insertions, 0 deletions
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 (
<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} />