Skip to content

Commit

Permalink
Also add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rzats committed May 22, 2024
1 parent 4bfff8a commit dc11442
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/modes/indicator/IndicatorAbout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@
$: {
exportURL = '';
if (sensor && sensor.key.split('-').length >= 2) {
// account for dashes in the sensor
// Given a sensor key formatted "sensor-name-here-signal_name_here", split on the last dash
let [last, ...rest] = sensor.key.split('-').reverse();
rest = rest.reverse().join('-');
exportURL += `data_source=${rest}&signal=${last}`;
}
if (region) {
exportURL += `&geo_type=${region.level}&geo_value=${region.propertyId}`;
}
if (date) {
exportURL += `&start_day=${formatDateISO(date.value)}&end_day=${formatDateISO(date.value)}`;
if (region) {
exportURL += `&geo_type=${region.level}&geo_value=${region.propertyId}`;
}
if (date) {
exportURL += `&start_day=${formatDateISO(date.value)}&end_day=${formatDateISO(date.value)}`;
}
}
}
</script>
Expand Down

0 comments on commit dc11442

Please sign in to comment.