Skip to content

Commit 346120f

Browse files
fix: ci
1 parent a91c8d0 commit 346120f

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

frontend/islands/admin/UserEdit.tsx

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 6 additions & 6 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default define.page<typeof handler>(function PublishingTasks({
104104
10,
105105
)}
106106
>
107-
{timeAgo(new Date(publishingTask.createdAt).getTime())}
107+
{timeAgo(new Date(publishingTask.createdAt))}
108108
</TableData>
109109
<TableData
110110
title={new Date(publishingTask.updatedAt).toISOString().slice(
@@ -113,7 +113,7 @@ export default define.page<typeof handler>(function PublishingTasks({
113113
)}
114114
align="right"
115115
>
116-
{timeAgo(new Date(publishingTask.updatedAt).getTime())}
116+
{timeAgo(new Date(publishingTask.updatedAt))}
117117
</TableData>
118118
<TableData
119119
title={new Date(publishingTask.createdAt).toISOString().slice(

frontend/routes/package/og.ts

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ function Version({
242242
{" "}
243243
</>
244244
)}
245-
{timeAgo(new Date(version.createdAt).getTime())}
245+
{timeAgo(new Date(version.createdAt))}
246246
</div>
247247
)}
248248
</div>
@@ -284,8 +284,7 @@ function Version({
284284
: <TbClockHour3 class="size-4 stroke-blue-500 stroke-2" />}
285285
<span>
286286
{ordinalNumber(tasks.length - i)} publishing attempt{" "}
287-
{statusVerb[task.status]}{" "}
288-
{timeAgo(new Date(task.updatedAt).getTime())}
287+
{statusVerb[task.status]} {timeAgo(new Date(task.updatedAt))}
289288
</span>
290289
<a href={`/status/${task.id}`} class="link justify-self-end z-20">
291290
Details

frontend/utils/timeAgo.ts

Lines changed: 2 additions & 0 deletions
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)