-
{loc && JSON.stringify(loc.info, null, 4)}
+
+ { /* // Clicked place and region */}
+
Place: {loc && String(loc.info.name, null, 4)}
+ Region: {loc && String(loc.info.region, null, 4)}
+
+ { /* // Closest to current time */ }
+ Weather at {loc && String(new Date(loc.data.t.timeValuePairs[24].time).toLocaleTimeString())}
+
Temp: {loc && String(loc.data.t.timeValuePairs[24].value || "no data ") + String(loc.data.t.property.unit)}
+
Snowdepth: {loc && String(loc.data.snowdepth.timeValuePairs[24].value || "no data ") + String(loc.data.snowdepth.property.unit)}
+
+ { /* // 3 hours from current time */ }
+
Weather was at {loc && String(new Date(loc.data.t.timeValuePairs[21].time).toLocaleTimeString())}
+
Temp: {loc && String(loc.data.t.timeValuePairs[21].value || "no data ") + String(loc.data.t.property.unit)}
+
Snowdepth: {loc && String(loc.data.snowdepth.timeValuePairs[21].value || "no data ") + String(loc.data.snowdepth.property.unit)}
+
+ { /* // 6 hours from current time */ }
+
Weather was at {loc && String(new Date(loc.data.t.timeValuePairs[18].time).toLocaleTimeString())}
+
Temp: {loc && String(loc.data.t.timeValuePairs[18].value || "no data ") + String(loc.data.t.property.unit)}
+
Snowdepth: {loc && String(loc.data.snowdepth.timeValuePairs[18].value || "no data ") + String(loc.data.snowdepth.property.unit)}
+
+ { /* // 9 hours from current time */ }
+
Weather was at {loc && String(new Date(loc.data.t.timeValuePairs[15].time).toLocaleTimeString())}
+
Temp: {loc && String(loc.data.t.timeValuePairs[15].value || "no data ") + String(loc.data.t.property.unit)}
+
Snowdepth: {loc && String(loc.data.snowdepth.timeValuePairs[15].value || "no data ") + String(loc.data.snowdepth.property.unit)}
+
+
}
export default styled(Sidebar)`
width: 300px;
height: 100vh;
-`;
\ No newline at end of file
+`;
From efc037128801b0aa17abbec27ddaf00a7d12f299 Mon Sep 17 00:00:00 2001
From: lEGENDARYskyE <43337911+lEGENDARYskyE@users.noreply.github.com>
Date: Tue, 22 Jan 2019 22:26:55 +0200
Subject: [PATCH 2/2] Update Sidebar.js
---
src/Sidebar.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/Sidebar.js b/src/Sidebar.js
index 8886b35..65fb163 100644
--- a/src/Sidebar.js
+++ b/src/Sidebar.js
@@ -8,27 +8,27 @@ function Sidebar({selectedLocationId, observationLocations}) {
const loc = observationLocations.find(loc => loc.info.id === id);
return
-
+
{ /* // Clicked place and region */}
Place: {loc && String(loc.info.name, null, 4)}
Region: {loc && String(loc.info.region, null, 4)}
- { /* // Closest to current time */ }
+ { /* // Closest to current time with data */ }
Weather at {loc && String(new Date(loc.data.t.timeValuePairs[24].time).toLocaleTimeString())}
Temp: {loc && String(loc.data.t.timeValuePairs[24].value || "no data ") + String(loc.data.t.property.unit)}
Snowdepth: {loc && String(loc.data.snowdepth.timeValuePairs[24].value || "no data ") + String(loc.data.snowdepth.property.unit)}
- { /* // 3 hours from current time */ }
+ { /* // 3 hours from closest current time */ }
Weather was at {loc && String(new Date(loc.data.t.timeValuePairs[21].time).toLocaleTimeString())}
Temp: {loc && String(loc.data.t.timeValuePairs[21].value || "no data ") + String(loc.data.t.property.unit)}
Snowdepth: {loc && String(loc.data.snowdepth.timeValuePairs[21].value || "no data ") + String(loc.data.snowdepth.property.unit)}
- { /* // 6 hours from current time */ }
+ { /* // 6 hours from closest current time */ }
Weather was at {loc && String(new Date(loc.data.t.timeValuePairs[18].time).toLocaleTimeString())}
Temp: {loc && String(loc.data.t.timeValuePairs[18].value || "no data ") + String(loc.data.t.property.unit)}
Snowdepth: {loc && String(loc.data.snowdepth.timeValuePairs[18].value || "no data ") + String(loc.data.snowdepth.property.unit)}
- { /* // 9 hours from current time */ }
+ { /* // 9 hours from closest current time */ }
Weather was at {loc && String(new Date(loc.data.t.timeValuePairs[15].time).toLocaleTimeString())}
Temp: {loc && String(loc.data.t.timeValuePairs[15].value || "no data ") + String(loc.data.t.property.unit)}
Snowdepth: {loc && String(loc.data.snowdepth.timeValuePairs[15].value || "no data ") + String(loc.data.snowdepth.property.unit)}