From 978ea7e2318d80ce3927f29b78c980dba7e93b87 Mon Sep 17 00:00:00 2001 From: Dobromir Popov Date: Thu, 29 Feb 2024 00:15:24 +0200 Subject: [PATCH] fix imports --- pages/cart/publishers/import.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/cart/publishers/import.tsx b/pages/cart/publishers/import.tsx index cc7e8cb..02dc288 100644 --- a/pages/cart/publishers/import.tsx +++ b/pages/cart/publishers/import.tsx @@ -146,7 +146,7 @@ export default function ImportPage() { let isOld = false; const row = rawData[i]; - var email, phone, names, dateOfInput, oldAvDeleted = false, isTrained = false, desiredShiftsPerMonth = 4, isActive = false, publisherType = PublisherType.Publisher; + let email, phone, names, dateOfInput, oldAvDeleted = false, isTrained = false, desiredShiftsPerMonth = 4, isActive = false, publisherType = PublisherType.Publisher; //const date = new Date(row[0]).toISOS{tring().slice(0, 10); if (mode.mainMode == MODE_PUBLISHERS1) { @@ -180,6 +180,7 @@ export default function ImportPage() { const day = new Date(); day.setDate(1); // Set to the first day of the month to avoid overflow + dateOfInput = new Date(dateOfInput); // Calculate the total month difference by considering the year difference let totalMonthDifference = (day.getFullYear() - dateOfInput.getFullYear()) * 12 + (day.getMonth() - dateOfInput.getMonth()); // If the total month difference is 2 or more, set isOld to true