Skip to content

Commit

Permalink
fix: date format in collection-item
Browse files Browse the repository at this point in the history
  • Loading branch information
olexh committed Jun 23, 2024
1 parent d5363e2 commit feb57a2
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import formatDistance from 'date-fns/formatDistance';
import format from 'date-fns/format';
import { FC, Fragment, memo } from 'react';
import BxBxsUpvote from '~icons/bx/bxs-upvote';
import IconamoonCommentFill from '~icons/iconamoon/comment-fill';
Expand Down Expand Up @@ -35,11 +35,7 @@ const CollectionItem: FC<Props> = ({ data, className }) => {
</div>
<div className="flex gap-1">
<MaterialSymbolsDriveFileRenameOutlineRounded />
<Small>
{formatDistance(data.updated * 1000, Date.now(), {
addSuffix: true,
})}
</Small>
<Small>{format(new Date(data.updated * 1000), 'd.MM.Y')}</Small>
</div>
</Fragment>
);
Expand Down

0 comments on commit feb57a2

Please sign in to comment.