Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix: improved displayed date
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Jul 10, 2024
1 parent 9582c56 commit e833b0d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/repo/status/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
StarIcon,
TicketIcon,
} from "@heroicons/react/20/solid";
import { formatDistance } from "date-fns";

import Heading from "@/components/Heading";
import List from "@/components/List";
Expand Down Expand Up @@ -207,7 +208,12 @@ export default function Page() {
extras={[
{ icon: StarIcon, text: repo.stargazers_count },
{ icon: LanguageIcon, text: repo.language },
{ icon: ClockIcon, text: repo.updated_at },
{
icon: ClockIcon,
text: formatDistance(repo.updated_at, new Date(), {
addSuffix: true,
}),
},
{ icon: TicketIcon, text: repo.open_issues },
]}
/>
Expand Down

0 comments on commit e833b0d

Please sign in to comment.