fix production TypeScript date formatting
This commit is contained in:
+12
-15
@@ -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
@@ -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",
|
||||
});
|
||||
}}
|
||||
})
|
||||
}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user