Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fixes time parse of date outside of valid range, fixes #1790

Edward Plato6bd107982cf6
diff --git a/web/js/location.js b/web/js/location.js
index ecab55894..cba3136a0 100644
--- a/web/js/location.js
+++ b/web/js/location.js
@@ -167,7 +167,16 @@ const getParameters = function(config, parameters) {
: serializeDate(currentItemState);
},
parse: str => {
- return tryCatchDate(str, now);
+ let time = tryCatchDate(str, now);
+ if (time instanceof Date) {
+ let startDate = new Date(config.startDate);
+ if (time < startDate) {
+ time = startDate;
+ } else if (time > now) {
+ time = now;
+ }
+ }
+ return time;
}
}
},