mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 12:25:22 +02:00
fix: add safe generic fallback to date parsers to prevent parse errors
This commit is contained in:
@@ -72,7 +72,8 @@ const ExperimentDetail: React.FC<ExperimentDetailProps> = ({ experimentId, onClo
|
||||
const productBreakdown = useMemo(() => {
|
||||
if (!experiment || targetAsins.length <= 1 || !salesData.length) return null;
|
||||
|
||||
const parseDate = (d: string) => {
|
||||
const parseDate = (d?: string) => {
|
||||
if (!d) return new Date();
|
||||
const [y, m, da] = d.split('T')[0].split('-');
|
||||
return new Date(Number(y), Number(m) - 1, Number(da));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user