fix: reject invalid dates in analytics

This commit is contained in:
2026-09-06 16:28:17 +03:00
parent d00177ccc8
commit 5a4371f5ed
3 changed files with 14 additions and 2 deletions
+3 -1
View File
@@ -143,7 +143,9 @@ export function parseDateTR(s) {
if (!s) return null;
const m = String(s).match(/(\d{1,2})[.\/](\d{1,2})[.\/](\d{4})/);
if (!m) return null;
return new Date(Number(m[3]), Number(m[2]) - 1, Number(m[1]));
const day=Number(m[1]),month=Number(m[2]),year=Number(m[3]);
const date=new Date(year,month-1,day);
return date.getFullYear()===year && date.getMonth()===month-1 && date.getDate()===day ? date : null;
}
// --- Firmanın kendi performansı (kullanıcının kanban/takip durumundan) ---