Skip to content
Snippets Groups Projects
Commit bb9ac60f authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Add references of variable in referred parameters column.

parent 097b1e59
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,8 @@
export let parameters: Parameter[]
export let variable: Variable
const dateFormatter = new Intl.DateTimeFormat("fr-FR", { dateStyle: "full" })
$: directParametersName = getVariableFormula(variable, date)?.parameters ?? []
$: latestFormulaDate = getVariableLatestFormulaDate(variable)
......@@ -34,6 +36,28 @@
{variable.label ?? variable.name}
</h1>
{#if variable.reference !== undefined}
{#each Object.entries(variable.reference).sort( ([instant1], [instant2]) => instant2.localeCompare(instant1), ) as [instant, references]}
{#each references as { href, note, title }}
{#if note !== undefined}
<article class="m-2">
<div>{note}</div>
<footer class="text-right">
{#if href === undefined}
{#if title !== undefined}
<span>{title}</span>
{/if}
{:else}
<a class="link" {href} target="_blank">{title ?? href}</a>
{/if}
<span>(consulté le {dateFormatter.format(new Date(instant))})</span>
</footer>
</article>
{/if}
{/each}
{/each}
{/if}
{#if latestFormulaDate !== null}
<div class="bg-gray-100 flex text-sm p-2 sm:p-1 md:p-2">
{#if latestFormulaDate < "2020"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment