Skip to content

Commit

Permalink
Format timestamps in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckal777 committed Aug 7, 2024
1 parent da9c784 commit deb3c92
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
</style>
<script defer src="alpinejs@3.11.1.js"></script>
<script>
const dateOpts = {
year: "numeric",
month: "numeric",
day: "numeric",
hour: "numeric",
minute: "numeric",
second: "numeric",
hour12: false,
};
const dateFmt = new Intl.DateTimeFormat("en-US", dateOpts);
const nodeRequest = new Request("/api/v1/info");
nodeRequest.method = "GET";

Expand Down Expand Up @@ -114,7 +124,7 @@ <h2>Details</h2>
</form>
<template x-if="current !== null">
<div>
<span x-text="`Snapshot of checks at ${current.updated}`"></span>
<span x-text="`Snapshot of checks at ${dateFmt.format(new Date(current.updated))}`"></span>
<div class="pure-g">
<template x-for="profile in current.profiles">
<div class="pure-u-1 pure-u-lg-1-2 pure-u-xl-1-3">
Expand Down

0 comments on commit deb3c92

Please sign in to comment.