From aaf85e37dd059015a3dd0ba431fa79dc854b2fc0 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 26 Nov 2024 17:59:05 +1100 Subject: [PATCH] more cleanup --- src/components/chart.astro | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/chart.astro b/src/components/chart.astro index 42c614bc..afebe8c0 100644 --- a/src/components/chart.astro +++ b/src/components/chart.astro @@ -2,6 +2,11 @@ const { title, data } = Astro.props; import crypto from "crypto"; let id = crypto.randomBytes(20).toString("hex"); +declare global { + interface Window { + drawChart: any; + } +} --- @@ -23,7 +28,7 @@ let id = crypto.randomBytes(20).toString("hex"); import "chartjs-adapter-luxon"; window.drawChart = function (targetId, duration_chart) { const now = DateTime.fromISO("12:00"); - const ctx = document.getElementById(targetId); + const ctx: any = document.getElementById(targetId); let onset = Duration.fromISO("PT" + duration_chart.onset.toUpperCase()); let coming_up = Duration.fromISO( "PT" + duration_chart.coming_up.toUpperCase(),