Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3721c6e

Browse files
committedMar 11, 2025··
fix: ci
1 parent efad61a commit 3721c6e

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed
 

‎frontend/islands/admin/UserEdit.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default function UserEdit({ user }: { user: FullUser }) {
6868
: String(isBlocked)}
6969
</TableData>
7070
<TableData title={new Date(user.createdAt).toISOString().slice(0, 10)}>
71-
{timeAgo(new Date(user.createdAt).getTime())}
71+
{timeAgo(new Date(user.createdAt))}
7272
</TableData>
7373
<TableData class="relative whitespace-nowrap space-x-3 py-4 pl-3 pr-4 text-right text-sm font-semibold sm:pr-6">
7474
{edit

‎frontend/routes/account/(_components)/AccountLayout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function AccountLayout({ user, active, children }: AccountLayoutProps) {
2525
{user.name}
2626
</h1>
2727
<p class="text-xs text-jsr-gray-600">
28-
Created account {timeAgo(new Date(user.createdAt).getTime())}
28+
Created account {timeAgo(new Date(user.createdAt))}
2929
</p>
3030
<p class="text-base mt-2">
3131
<GitHubUserLink user={user} />

‎frontend/routes/account/tokens/index.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function PersonalTokenRow({ token }: { token: Token }) {
105105
<b>Active</b> {expiresAt === null
106106
? "forever"
107107
: `– expires ${
108-
timeAgo(new Date().getTime(), expiresAt.getTime()).replace(
108+
timeAgo(expiresAt).replace(
109109
"ago",
110110
"from now",
111111
)
@@ -114,12 +114,12 @@ function PersonalTokenRow({ token }: { token: Token }) {
114114
)
115115
: (
116116
<span class="text-red-600">
117-
<b>Inactive</b> - expired {timeAgo(expiresAt.getTime())}
117+
<b>Inactive</b> - expired {timeAgo(expiresAt)}
118118
</span>
119119
)}
120120
</p>
121121
<p class="text-sm sm:text-right">
122-
Created {timeAgo(new Date(token.createdAt).getTime())}
122+
Created {timeAgo(new Date(token.createdAt))}
123123
</p>
124124
</div>
125125
<p class="text-sm text-jsr-gray-600">
@@ -160,7 +160,7 @@ function SessionRow({ token }: { token: Token }) {
160160
<b>Active</b> {expiresAt === null
161161
? "forever"
162162
: `– expires ${
163-
timeAgo(expiresAt.getTime()).replace(
163+
timeAgo(expiresAt).replace(
164164
"ago",
165165
"from now",
166166
)
@@ -169,7 +169,7 @@ function SessionRow({ token }: { token: Token }) {
169169
)
170170
: (
171171
<span class="text-red-600">
172-
<b>Inactive</b> - expired {timeAgo(expiresAt.getTime())}
172+
<b>Inactive</b> - expired {timeAgo(expiresAt)}
173173
</span>
174174
)}
175175

@@ -178,7 +178,7 @@ function SessionRow({ token }: { token: Token }) {
178178
</div>
179179
<div>
180180
<p class="text-sm sm:text-right">
181-
Created {timeAgo(new Date(token.createdAt).getTime())}
181+
Created {timeAgo(new Date(token.createdAt))}
182182
</p>
183183
</div>
184184
</div>

‎frontend/routes/admin/publishingTasks.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ export default define.page<typeof handler>(function PublishingTasks({
7777
10,
7878
)}
7979
>
80-
{timeAgo(new Date(publishingTask.createdAt).getTime())}
80+
{timeAgo(new Date(publishingTask.createdAt))}
8181
</TableData>
8282
<TableData
8383
title={new Date(publishingTask.updatedAt).toISOString().slice(
8484
0,
8585
10,
8686
)}
8787
>
88-
{timeAgo(new Date(publishingTask.updatedAt).getTime())}
88+
{timeAgo(new Date(publishingTask.updatedAt))}
8989
</TableData>
9090
<TableData>
9191
<PublishingTaskRequeue publishingTask={publishingTask} />

‎frontend/routes/package/og.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export const handler = define.handlers({
263263
const publishDateText = Image.renderText(
264264
dmmonoFont,
265265
25,
266-
timeAgo(new Date(selectedVersion.createdAt).getTime()),
266+
timeAgo(new Date(selectedVersion.createdAt)),
267267
COLOR_GRAY,
268268
);
269269
const result = new Image(

‎frontend/routes/package/versions.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ function Version({
239239
{" "}
240240
</>
241241
)}
242-
{timeAgo(new Date(version.createdAt).getTime())}
242+
{timeAgo(new Date(version.createdAt))}
243243
</div>
244244
)}
245245
</div>
@@ -268,8 +268,7 @@ function Version({
268268
: <TbClockHour3 class="size-4 stroke-blue-500 stroke-2" />}
269269
<span>
270270
{ordinalNumber(tasks.length - i)} publishing attempt{" "}
271-
{statusVerb[task.status]}{" "}
272-
{timeAgo(new Date(task.updatedAt).getTime())}
271+
{statusVerb[task.status]} {timeAgo(new Date(task.updatedAt))}
273272
</span>
274273
<a href={`/status/${task.id}`} class="link justify-self-end z-20">
275274
Details

‎frontend/utils/timeAgo.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Copyright 2024 the JSR authors. All rights reserved. MIT license.
12
export function timeAgo(date: Date | string): string {
23
const now = new Date();
34
const past = new Date(date);
@@ -17,6 +18,7 @@ export function timeAgo(date: Date | string): string {
1718
};
1819

1920
// Force english because JSR is an English-only project
21+
// @ts-ignore - TS doesn't know about this API yet
2022
const formatter = new Intl.DurationFormat("en", { style: "long" });
2123
return formatter.format(duration);
2224
}

0 commit comments

Comments
 (0)
Please sign in to comment.