From 8d2cb1a771d77d8f65ffed0ddfd0eab38d156b78 Mon Sep 17 00:00:00 2001
From: mbucknell <mbucknell@usgs.gov>
Date: Mon, 3 Jan 2022 12:46:55 -0600
Subject: [PATCH] Fixed initialization of time span when parameter code has no
 IV data.

---
 .../scripts/monitoring-location/components/hydrograph/index.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/index.js b/assets/src/scripts/monitoring-location/components/hydrograph/index.js
index d59c1254d..a35a6362d 100644
--- a/assets/src/scripts/monitoring-location/components/hydrograph/index.js
+++ b/assets/src/scripts/monitoring-location/components/hydrograph/index.js
@@ -80,7 +80,8 @@ export const attachToNode = function(store,
             end: endDT
         }));
     } else {
-        store.dispatch(setSelectedTimeSpan('P7D'));
+        store.dispatch(setSelectedTimeSpan(config.ivPeriodOfRecord && config.ivPeriodOfRecord[parameterCode] ?
+            'P7D' : 'P1Y'));
     }
 
     // Fetch all data needed to render the hydrograph
-- 
GitLab