From 03eea4015d8db8ae9b2fb6ffdff43a6147ad8c52 Mon Sep 17 00:00:00 2001 From: 4cuck <40539855+4cuck@users.noreply.github.com> Date: Mon, 19 Feb 2024 03:18:57 +0100 Subject: [PATCH] fixup date annotation --- server/src/api.rs | 2 +- server/static/history.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/api.rs b/server/src/api.rs index 79ffa11..b01efe1 100644 --- a/server/src/api.rs +++ b/server/src/api.rs @@ -47,7 +47,7 @@ pub async fn graph( data.push_str("Date,Healthy,Dead\n"); for entry in healthy_data { - let time = Utc.timestamp_opt(entry.time,0).unwrap(); + let time = Utc.timestamp_opt(entry.time,0).unwrap().format("%Y-%m-%dT%H:%M:%SZ"); writeln!(&mut data, "{},{},{}",time,entry.alive,entry.dead) .map_err(|e|ServerError::CSV(e.to_string()))?; } diff --git a/server/static/history.js b/server/static/history.js index 6e71ca3..5d08013 100644 --- a/server/static/history.js +++ b/server/static/history.js @@ -31,13 +31,13 @@ async function loadGraph() { g.ready(function() { g.setAnnotations([ { - series: "Temperature", + series: "Healthy", x: "2023-05-18", shortText: "G", text: "First API Change" }, { - series: "Temperature", + series: "Healthy", x: "2024-01-24", shortText: "D", text: "API Shutdown"