@@ -5,7 +5,7 @@ import { define } from "../../../util.ts";
5
5
import { path } from "../../../utils/api.ts" ;
6
6
import { Token } from "../../../utils/api_types.ts" ;
7
7
import { AccountLayout } from "../(_components)/AccountLayout.tsx" ;
8
- import twas from "twas " ;
8
+ import { timeAgo } from "../../../utils/timeAgo.ts " ;
9
9
import { RevokeToken } from "./(_islands)/RevokeToken.tsx" ;
10
10
import TbPlus from "tb-icons/TbPlus" ;
11
11
@@ -105,7 +105,7 @@ function PersonalTokenRow({ token }: { token: Token }) {
105
105
< b > Active</ b > { expiresAt === null
106
106
? "forever"
107
107
: `– expires ${
108
- twas ( new Date ( ) . getTime ( ) , expiresAt . getTime ( ) ) . replace (
108
+ timeAgo ( expiresAt ) . replace (
109
109
"ago" ,
110
110
"from now" ,
111
111
)
@@ -114,12 +114,12 @@ function PersonalTokenRow({ token }: { token: Token }) {
114
114
)
115
115
: (
116
116
< span class = "text-red-600" >
117
- < b > Inactive</ b > - expired { twas ( expiresAt . getTime ( ) ) }
117
+ < b > Inactive</ b > - expired { timeAgo ( expiresAt ) }
118
118
</ span >
119
119
) }
120
120
</ p >
121
121
< p class = "text-sm sm:text-right" >
122
- Created { twas ( new Date ( token . createdAt ) . getTime ( ) ) }
122
+ Created { timeAgo ( new Date ( token . createdAt ) ) }
123
123
</ p >
124
124
</ div >
125
125
< p class = "text-sm text-secondary" >
@@ -160,7 +160,7 @@ function SessionRow({ token }: { token: Token }) {
160
160
< b > Active</ b > { expiresAt === null
161
161
? "forever"
162
162
: `– expires ${
163
- twas ( new Date ( ) . getTime ( ) , expiresAt . getTime ( ) ) . replace (
163
+ timeAgo ( expiresAt ) . replace (
164
164
"ago" ,
165
165
"from now" ,
166
166
)
@@ -169,7 +169,7 @@ function SessionRow({ token }: { token: Token }) {
169
169
)
170
170
: (
171
171
< span class = "text-red-600 dark:text-red-500" >
172
- < b > Inactive</ b > - expired { twas ( expiresAt . getTime ( ) ) }
172
+ < b > Inactive</ b > - expired { timeAgo ( expiresAt ) }
173
173
</ span >
174
174
) }
175
175
@@ -178,7 +178,7 @@ function SessionRow({ token }: { token: Token }) {
178
178
</ div >
179
179
< div >
180
180
< p class = "text-sm sm:text-right" >
181
- Created { twas ( new Date ( token . createdAt ) . getTime ( ) ) }
181
+ Created { timeAgo ( new Date ( token . createdAt ) ) }
182
182
</ p >
183
183
</ div >
184
184
</ div >
0 commit comments