Skip to content

Commit

Permalink
🐛 Fix incorrect comment time
Browse files Browse the repository at this point in the history
  • Loading branch information
kidonng committed Jun 23, 2023
1 parent f500ff6 commit 5ebf0dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/CommentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const CommentCard: Component<{ content: ReactiveComment; rootId: string }> = (pr
);
const [now] = createDateNow();
const { locale, commentClassName } = configProvider;
const time = createMemo(() => getTimeAgo(props.content.insertedAt, now(), locale()));
const time = createMemo(() => getTimeAgo(new Date(props.content.time), now(), locale()));
return (
<div id={props.content.objectId} class="sds-comment flex p-2 pe-0">
<div aria-hidden class="me-3 relative">
Expand Down
1 change: 1 addition & 0 deletions src/controllers/commentListState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface ReactiveComment extends Exclude<ReactiveCommentData, 'ua'> {
level?: number;
addr?: string;
label?: string;
time: number;
user_id?: string | number;
status?: WalineCommentStatus;
like: Accessor<number>;
Expand Down

0 comments on commit 5ebf0dd

Please sign in to comment.