summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-01-22 10:08:14 +0200
committerLars Wirzenius <liw@liw.fi>2024-01-22 10:08:14 +0200
commit49f6711e2224f0c0e9a80154ed3a7b8b805beb54 (patch)
treede044ce77bc5fcdc5e8ec3cfbc87d7909499dd46
parenta41e347952e9c3b72f359e7effd09018f0a92ed8 (diff)
downloadradicle-native-ci-49f6711e2224f0c0e9a80154ed3a7b8b805beb54.tar.gz
feat: put last-updated time stamp to top
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rw-r--r--src/report.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/report.rs b/src/report.rs
index 9020499..cc2ea2c 100644
--- a/src/report.rs
+++ b/src/report.rs
@@ -64,6 +64,12 @@ fn list_runs(repos: &[&str], run_infos: &[RunInfo]) -> Document {
doc.push_to_head(&Element::new(Tag::Title).with_text("CI run logs"));
doc.push_to_head(&Element::new(Tag::Style).with_text(CSS));
+ let fmt = format_description!("[year]-[month]-[day] [hour]:[minute]:[second]Z");
+ let now = OffsetDateTime::now_utc().format(fmt).expect("time format");
+
+ let timestamp = Element::new(Tag::Div).with_text(&format!("Last updated {}.", now));
+ doc.push_to_body(&timestamp);
+
for repo in repos {
let section = Element::new(Tag::H1)
.with_text("Repository ")
@@ -119,12 +125,6 @@ fn list_runs(repos: &[&str], run_infos: &[RunInfo]) -> Document {
doc.push_to_body(&list);
}
- let fmt = format_description!("[year]-[month]-[day] [hour]:[minute]:[second]Z");
- let now = OffsetDateTime::now_utc().format(fmt).expect("time format");
-
- let timestamp = Element::new(Tag::Div).with_text(&format!("Last updated {}.", now));
- doc.push_to_body(&timestamp);
-
doc
}