From 5b0159b4312a2547df55ca2e749e3b8550ac1440 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Bidoul?=
Date: Wed, 1 Dec 2021 15:43:04 +0100
Subject: [PATCH] Use GitHub time-ago element
---
src/runboat/webui-templates/runboat-build-element.js | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/runboat/webui-templates/runboat-build-element.js b/src/runboat/webui-templates/runboat-build-element.js
index 5691c37..a719f8b 100644
--- a/src/runboat/webui-templates/runboat-build-element.js
+++ b/src/runboat/webui-templates/runboat-build-element.js
@@ -1,8 +1,5 @@
import {LitElement, html, css} from 'https://unpkg.com/lit@2.0.2?module';
-import dayjs from 'https://unpkg.com/dayjs@1.10.7/esm';
-import relativeTime from 'https://unpkg.com/dayjs@1.10.7/esm/plugin/relativeTime';
-
-dayjs.extend(relativeTime);
+import 'https://unpkg.com/@github/time-elements@latest?module';
class RunboatBuildElement extends LitElement {
static get properties() {
@@ -39,7 +36,7 @@ class RunboatBuildElement extends LitElement {
.build-status-failed {
background-color: lightcoral;
}
- .age {
+ time-ago {
color: gray;
white-space: nowrap;
}
@@ -64,7 +61,7 @@ class RunboatBuildElement extends LitElement {
${this.build.commit_info?.git_commit?
html`(${this.build.commit_info?.git_commit.substring(0, 8)})`:""
}
- ${dayjs(this.build.created).fromNow()}
+
${this.build.status || "undeployed"}