fix production TypeScript date formatting

This commit is contained in:
mr.sabri
2026-07-22 07:10:30 +03:30
parent 18f84bfd41
commit 55ba2df7b6
2 changed files with 21 additions and 24 deletions
+12 -15
View File
@@ -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",
});
}}
})
}
/>
<ChartTooltip
content={
<ChartTooltipContent
className="w-[150px]"
nameKey="views"
labelFormatter={(value) => {
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",
})
}
/>
}
/>
+9 -9
View File
@@ -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",
});
}}
})
}
/>
<ChartTooltip
content={
<ChartTooltipContent
className="w-[150px]"
nameKey="views"
labelFormatter={(value) => {
return new Date(value).toLocaleDateString("fa-IR", {
labelFormatter={(value) =>
formatDateLabel(value, "fa-IR", {
month: "short",
day: "numeric",
year: "numeric",
});
}}
})
}
/>
}
/>