Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cmd/server/assets/admin/events/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ <h1>System event log</h1>
<div class="list-group-item flex-column align-items-start" id="event">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{$event.Action}}</h5>
<small
data-timestamp="{{$event.CreatedAt.Format "1/02/2006 3:04:05 PM UTC"}}"
data-toggle="tooltip" title="{{$event.CreatedAt.Format "2006-02-01 15:04 UTC"}}">
<small data-timestamp="{{$event.CreatedAt.Format "1/02/2006 3:04:05 PM UTC"}}">
{{$event.CreatedAt.Format "2006-02-01 15:04"}}
</small>
</div>
Expand Down
4 changes: 1 addition & 3 deletions cmd/server/assets/codes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ <h1>Verification code status</h1>
<a href="/codes/{{$code.UUID}}" class="list-group-item list-group-item-action">
<span class="text-monospace">{{$code.UUID}}</span>
<br />
<small
data-timestamp="{{$code.CreatedAt.Format "1/02/2006 3:04:05 PM UTC"}}"
data-toggle="tooltip" title="{{$code.CreatedAt.Format "2006-02-01 15:04 UTC"}}">
<small data-timestamp="{{$code.CreatedAt.Format "1/02/2006 3:04:05 PM UTC"}}">
{{$code.CreatedAt.Format "2006-02-01 15:04"}}
</small>
</a>
Expand Down
4 changes: 1 addition & 3 deletions cmd/server/assets/realmadmin/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ <h1>Realm event log</h1>
<div class="list-group-item flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{$event.Action}}</h5>
<small
data-timestamp="{{$event.CreatedAt.Format "1/02/2006 3:04:05 PM UTC"}}"
data-toggle="tooltip" title="{{$event.CreatedAt.Format "2006-02-01 15:04 UTC"}}">
<small data-timestamp="{{$event.CreatedAt.Format "1/02/2006 3:04:05 PM UTC"}}">
{{$event.CreatedAt.Format "2006-02-01 15:04"}}
</small>
</div>
Expand Down
30 changes: 5 additions & 25 deletions cmd/server/assets/static/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,31 +105,11 @@ $(function() {
$("[data-timestamp]").each(function(i, e) {
let $this = $(e);
let date = new Date($this.data("timestamp"));

let year = date.getFullYear();
let month = date.getMonth() + 1;
if (month < 10) {
month = `0${month}`;
}
let day = date.getDate();
if (day < 10) {
day = `0${day}`;
}
let ampm = "AM";
let hours = date.getHours();
if (hours > 12) {
ampm = "PM";
hours = hours - 12;
}
if (hours < 10) {
hours = `0${hours}`;
}
let minutes = date.getMinutes();
if (minutes < 10) {
minutes = `0${minutes}`;
}

$this.text(`${year}-${month}-${day} ${hours}:${minutes} ${ampm}`);
$this.tooltip({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well this sure looks simpler

placement: "top",
title: date.toISOString(),
});
$this.text(date.toLocaleString());
});

// Toast shows alerts/flash messages.
Expand Down