Skip to content

Commit 4d62c71

Browse files
committed
Revert "test"
This reverts commit 2a76c93.
1 parent 0566f0a commit 4d62c71

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/components/BigNumber/index.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { type ReactNode } from "react"
2+
import { useRouter } from "next/router"
23
import { useTranslation } from "next-i18next"
34
import { MdInfoOutline } from "react-icons/md"
45

56
import { cn } from "@/lib/utils/cn"
7+
import { isValidDate } from "@/lib/utils/date"
68

79
import Tooltip from "../Tooltip"
810
import Link from "../ui/Link"
@@ -25,13 +27,13 @@ const BigNumber = ({
2527
className,
2628
}: BigNumberProps) => {
2729
const { t } = useTranslation("common")
28-
// const { locale } = useRouter()
29-
// const lastUpdatedDisplay =
30-
// lastUpdated && isValidDate(lastUpdated)
31-
// ? new Intl.DateTimeFormat(locale, {
32-
// dateStyle: "medium",
33-
// }).format(new Date(lastUpdated))
34-
// : ""
30+
const { locale } = useRouter()
31+
const lastUpdatedDisplay =
32+
lastUpdated && isValidDate(lastUpdated)
33+
? new Intl.DateTimeFormat(locale, {
34+
dateStyle: "medium",
35+
}).format(new Date(lastUpdated))
36+
: ""
3537
return (
3638
<div
3739
className={cn(
@@ -54,8 +56,7 @@ const BigNumber = ({
5456
</p>
5557
{lastUpdated && (
5658
<p className="mt-2">
57-
{t("last-updated")}:{" "}
58-
{new Date(lastUpdated).toISOString()}
59+
{t("last-updated")}: {lastUpdatedDisplay}
5960
</p>
6061
)}
6162
</>

0 commit comments

Comments
 (0)