diff --git a/blocks/hero242.tsx b/blocks/hero242.tsx index 6e98a01..8839fe9 100644 --- a/blocks/hero242.tsx +++ b/blocks/hero242.tsx @@ -12,6 +12,7 @@ import { ChartTooltip, ChartTooltipContent, } from "@/components/ui/chart"; +import { formatDateLabel } from "@/lib/to-date-input"; import { cn } from "@/lib/utils"; interface Hero242Props { @@ -143,29 +144,25 @@ const Hero242 = ({ className }: Hero242Props) => { axisLine={false} tickMargin={8} minTickGap={32} - tickFormatter={(value) => { - const date = new Date(value); - return date.toLocaleDateString("en-US", { + tickFormatter={(value) => + formatDateLabel(value, "en-US", { month: "short", day: "numeric", - }); - }} + }) + } /> { - return new Date(String(value)).toLocaleDateString( - "en-US", - { - month: "short", - day: "numeric", - year: "numeric", - } - ); - }} + labelFormatter={(value) => + formatDateLabel(value, "en-US", { + month: "short", + day: "numeric", + year: "numeric", + }) + } /> } /> diff --git a/blocks/hero246.tsx b/blocks/hero246.tsx index 6147d80..6509e11 100644 --- a/blocks/hero246.tsx +++ b/blocks/hero246.tsx @@ -10,6 +10,7 @@ import { ChartTooltip, ChartTooltipContent, } from "@/components/ui/chart"; +import { formatDateLabel } from "@/lib/to-date-input"; import { cn } from "@/lib/utils"; const bgPattern = { @@ -118,26 +119,25 @@ const Hero246 = ({ className }: Hero246Props) => { axisLine={false} tickMargin={8} minTickGap={32} - tickFormatter={(value) => { - const date = new Date(value); - return date.toLocaleDateString("fa-IR", { + tickFormatter={(value) => + formatDateLabel(value, "fa-IR", { month: "short", day: "numeric", - }); - }} + }) + } /> { - return new Date(value).toLocaleDateString("fa-IR", { + labelFormatter={(value) => + formatDateLabel(value, "fa-IR", { month: "short", day: "numeric", year: "numeric", - }); - }} + }) + } /> } />