Skip to content

Commit 9ac5e75

Browse files
authored
Fix timezone display in history page (#479)
1 parent 955ea5c commit 9ac5e75

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/helpers/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ export const MAX_CONVERT_PROCESS =
2323

2424
export const UNAUTHENTICATED_USER_SHARING =
2525
process.env.UNAUTHENTICATED_USER_SHARING?.toLowerCase() === "true" || false;
26+
27+
export const TIMEZONE = process.env.TZ || undefined;

src/pages/history.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BaseHtml } from "../components/base";
33
import { Header } from "../components/header";
44
import db from "../db/db";
55
import { Filename, Jobs } from "../db/types";
6-
import { ALLOW_UNAUTHENTICATED, HIDE_HISTORY, LANGUAGE, WEBROOT } from "../helpers/env";
6+
import { ALLOW_UNAUTHENTICATED, HIDE_HISTORY, LANGUAGE, TIMEZONE, WEBROOT } from "../helpers/env";
77
import { userService } from "./user";
88
import { EyeIcon } from "../icons/eye";
99
import { DeleteIcon } from "../icons/delete";
@@ -129,7 +129,11 @@ export const history = new Elysia().use(userService).get(
129129
/>
130130
</svg>
131131
</td>
132-
<td safe>{new Date(job.date_created).toLocaleTimeString(LANGUAGE)}</td>
132+
<td safe>
133+
{new Date(job.date_created).toLocaleTimeString(LANGUAGE, {
134+
timeZone: TIMEZONE,
135+
})}
136+
</td>
133137
<td>{job.num_files}</td>
134138
<td class="max-sm:hidden">{job.finished_files}</td>
135139
<td safe>{job.status}</td>

0 commit comments

Comments
 (0)