Skip to content

Commit e6a3a01

Browse files
committed
Show local time on pending status hover
1 parent 5748818 commit e6a3a01

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/templates.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::database::{
33
};
44
use askama::Template;
55
use axum::response::{Html, IntoResponse, Response};
6+
use chrono::{DateTime, Local, Utc};
67
use http::StatusCode;
78

89
/// Build status to display on the queue page.
@@ -69,6 +70,12 @@ pub struct QueueTemplate {
6970
pub oauth_client_id: Option<String>,
7071
}
7172

73+
impl QueueTemplate {
74+
fn to_local_time(&self, time: DateTime<Utc>) -> DateTime<Local> {
75+
time.into()
76+
}
77+
}
78+
7279
#[derive(Template)]
7380
#[template(path = "not_found.html")]
7481
pub struct NotFoundTemplate {}

templates/queue.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ <h1>
156156
{% let pending_build = crate::templates::get_pending_build(pr) %}
157157
<td class="status" data-status="{{ crate::templates::status_text(pr) }}"
158158
{% if let Some(build) = pending_build %}
159-
title="{{ build.created_at.format("%d.%m.%Y %H:%M:%S") }} UTC"
159+
title="Started at {{ to_local_time(*build.created_at).format("%d.%m.%Y %H:%M:%S") }}"
160160
data-created-at="{{ build.created_at.timestamp_millis() }}"
161161
{% endif %}>
162162

0 commit comments

Comments
 (0)