-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 'latest known data' link now preserves context * Set default date to the date we have data for all 3 sensors. * Made Hospital Admissions sensor work as Doctor Visits and Deaths. Removed annotation for Hospital Admissions sensor when we don't have recent data for chosen date
- Loading branch information
1 parent
3fd07be
commit 0b42ad1
Showing
4 changed files
with
111 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<script> | ||
import { formatDateYearDayOfWeekAbbr } from '../formats'; | ||
import { formatAPITime } from '../data'; | ||
/** | ||
* @type {import("../stores/params").DateParam} | ||
*/ | ||
export let minMaxDate; | ||
/** | ||
* @type {import("../stores/params").DateParam} | ||
*/ | ||
export let date; | ||
export let warningType; | ||
function switchDate() { | ||
date.set(minMaxDate); | ||
} | ||
</script> | ||
|
||
{#if warningType === 1} | ||
<div data-uk-alert class="uk-alert-warning"> | ||
<p> | ||
This date, {formatDateYearDayOfWeekAbbr(minMaxDate)}, is the most recent that has data for all three of the | ||
highlighted indicators. You can mouse over the tooltips just below this message to see the latest available date | ||
for each indicator. Note that the latest available date may be different for each indicator. | ||
</p> | ||
</div> | ||
{/if} | ||
|
||
{#if warningType === 2} | ||
<div data-uk-alert class="uk-alert-warning"> | ||
<p> | ||
This date ({formatDateYearDayOfWeekAbbr(date.value)}) does not yet have data for all of the highlighted | ||
indicators. | ||
<br /> | ||
<!-- | ||
window.location.search.split('&').slice(1).join('&') is used to keep the query parameters except the date parameter. | ||
So we are getting query params from url, splitting them by & and removing the first element which is date parameter. | ||
--> | ||
<a | ||
href="?date={formatAPITime(minMaxDate)}&{window.location.search.split('&').slice(1).join('&')}" | ||
on:click={switchDate}>{formatDateYearDayOfWeekAbbr(minMaxDate)}</a | ||
> | ||
is the most recent that has data for all three. You can mouse over the tooltips just below this message to see the | ||
latest available date for each indicator. Note that the latest available date may be different for each indicator. | ||
</p> | ||
</div> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters