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]"
|
||||
nameKey="views"
|
||||
labelFormatter={(value) => {
|
||||
return new Date(value).toLocaleDateString("en-US", {
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
});
|
||||
return new Date(String(value)).toLocaleDateString(
|
||||
"en-US",
|
||||
{
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
}
|
||||
);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user