diff --git a/src/lib/components/blocks/StrommixBlock.svelte b/src/lib/components/blocks/StrommixBlock.svelte index c63ddfd..efc0435 100644 --- a/src/lib/components/blocks/StrommixBlock.svelte +++ b/src/lib/components/blocks/StrommixBlock.svelte @@ -99,6 +99,15 @@ return d.toLocaleTimeString("de-DE", { hour: "2-digit", minute: "2-digit" }); } + /** Cross-border data is considered stale (and worth flagging) when its + * timestamp is more than 30 min behind the production-snapshot. cbpf + * typically lags 1.5–2 h, so this is the rule rather than the + * exception — surfacing the stamp keeps the widget honest. */ + const cbStale = $derived.by(() => { + if (!live?.measuredAtUnix || !live?.crossborderMeasuredAtUnix) return false; + return live.measuredAtUnix - live.crossborderMeasuredAtUnix > 30 * 60; + }); + const bucketAccent = $derived.by(() => { if (!bucket) return "neutral"; return bucket === "dunkelflaute" @@ -198,6 +207,7 @@
Konventionell jetzt
{fmtMw(live.conventionalMw)}
+
Braunkohle + Steinkohle + Erdgas + Kernkraft
@@ -208,6 +218,12 @@ {#if importDirection === "Export"}↑{/if} {fmtGw(live.netFlowGw)}
+ {#if live.crossborderMeasuredAtUnix} +
+ Stand: {fmtTime(live.crossborderMeasuredAtUnix)} Uhr + {#if cbStale} · verzögert{/if} +
+ {/if}
@@ -218,6 +234,11 @@ {#if enableFr && live.priceFrEurMwh != null} (Frankreich: {fmtPrice(live.priceFrEurMwh)}) {/if} + {#if live.priceMeasuredAtUnix} + + · Slot {fmtTime(live.priceMeasuredAtUnix)} + + {/if} {#if (live.priceDeEurMwh ?? 0) < 0}