mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 13:55:23 +02:00
fix: add safe generic fallback to date parsers to prevent parse errors
This commit is contained in:
@@ -232,7 +232,8 @@ export const calculateExperimentPerformance = async (
|
||||
experiment_acos: number;
|
||||
actual_lift_percent: number;
|
||||
}> => {
|
||||
const parseLocalDate = (dateStr: string) => {
|
||||
const parseLocalDate = (dateStr?: string) => {
|
||||
if (!dateStr) return new Date();
|
||||
const [y, m, d] = dateStr.split('T')[0].split('-');
|
||||
return new Date(Number(y), Number(m) - 1, Number(d));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user