Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: timediff 함수 버그 수정 #190

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function ListInformation() {
<div className={styles.informationWrapper}>
<div className={styles.listOwnerNickname}>{list?.ownerNickname}</div>
<div className={styles.infoDetailWrapper}>
<span>{timeDiff(String(list?.createdDate))}</span>
<span>{timeDiff(String(list?.lastUpdatedDate))}</span>
{list?.isPublic === false && <LockIcon width={12} height={12} fill={vars.color.gray5} />}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/time-diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

export default function timeDiff(dateString: string) {
const dateObject = new Date(dateString);
const now = new Date(new Date().getTime() - 9 * 60 * 60 * 1000);
const now = new Date(new Date().getTime());
const diff = (now.getTime() - dateObject.getTime()) / 1000;

const year = dateObject.getFullYear().toString();
Expand Down