Skip to content

Commit f978fa7

Browse files
committed
Revert time clamping, modify comment
1 parent d9f12de commit f978fa7

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

src/modes/exportdata/ExportData.svelte

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929
3030
// Pre-fill the form from URL parameters.
31-
// Supported parameters: source, sensor, start, end, geo_type, geo_id
31+
// Supported parameters: data_source, signal, start_day, end_day, geo_type, geo_value, as_of
3232
const urlParams = new URLSearchParams(window.location.search);
3333
3434
// Overwrite default source & sensor if these are present in the URL
@@ -52,30 +52,8 @@
5252
const param = new DateParam(date);
5353
5454
// Populate date based on URL params or, if absent, the current date
55-
if (sensor && !sensor.active) {
56-
// If the sensor is inactive, set the start and end dates to its historical range rather than current date
57-
if (
58-
urlParams.has('start_day') &&
59-
new Date(urlParams.get('start_day')) >= sensor.meta.minTime &&
60-
new Date(urlParams.get('start_day')) <= sensor.meta.maxTime
61-
) {
62-
startDate = new Date(urlParams.get('start_day'));
63-
} else {
64-
startDate = sensor.meta.minTime;
65-
}
66-
if (
67-
urlParams.has('end_day') &&
68-
new Date(urlParams.get('end_day')) <= sensor.meta.minTime &&
69-
new Date(urlParams.get('end_day')) <= sensor.meta.maxTime
70-
) {
71-
endDate = new Date(urlParams.get('end_day'));
72-
} else {
73-
endDate = sensor.meta.maxTime;
74-
}
75-
} else {
76-
startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min;
77-
endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max;
78-
}
55+
startDate = urlParams.has('start_day') ? new Date(urlParams.get('start_day')) : param.sparkLineTimeFrame.min;
56+
endDate = urlParams.has('end_day') ? new Date(urlParams.get('end_day')) : param.sparkLineTimeFrame.max;
7957
}
8058
$: initDate($currentDateObject);
8159

0 commit comments

Comments
 (0)