Fix hero242 ChartTooltip labelFormatter Date typing.
String-coerce the ReactNode label so production TypeScript builds accept new Date(). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+8
-5
@@ -157,11 +157,14 @@ const Hero242 = ({ className }: Hero242Props) => {
|
|||||||
className="w-[150px]"
|
className="w-[150px]"
|
||||||
nameKey="views"
|
nameKey="views"
|
||||||
labelFormatter={(value) => {
|
labelFormatter={(value) => {
|
||||||
return new Date(value).toLocaleDateString("en-US", {
|
return new Date(String(value)).toLocaleDateString(
|
||||||
month: "short",
|
"en-US",
|
||||||
day: "numeric",
|
{
|
||||||
year: "numeric",
|
month: "short",
|
||||||
});
|
day: "numeric",
|
||||||
|
year: "numeric",
|
||||||
|
}
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user