Skip to content

Commit

Permalink
Merge pull request #4 from kidonng/fix-time
Browse files Browse the repository at this point in the history
🐛 Fix incorrect comment time
  • Loading branch information
BeiyanYunyi authored Jun 24, 2023
2 parents f500ff6 + 5ebf0dd commit cceaf28
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 cceaf28

Please sign in to comment.