feat: updated renovation dates to be within last 6 months

This commit is contained in:
Satyam
2026-02-01 19:36:30 +05:30
parent 2e64c3778d
commit 591c78cb41
+22
View File
@@ -453,6 +453,28 @@ function generateProperties() {
} }
}); });
// 4. Refine Renovation Dates (Recent for 'Renovated' status)
// User Request: Not older than 6 months from Feb 2026 (Aug 2025 - Feb 2026)
allProperties.forEach(prop => {
if (prop.canvassingStatus === "Renovated") {
const monthsBack = Math.floor(Math.random() * 6); // 0 to 5 months ago
// Base date: Feb 2026.
// 0 months ago = Feb 2026. 1 = Jan 2026... 5 = Sep 2025.
// Let's pick a random day.
const year = monthsBack <= 1 ? 2026 : 2025;
let month = 2 - monthsBack; // Feb(2) - 0 = 2. Feb(2) - 5 = -3.
if (month <= 0) month += 12; // Wrap around to previous year
const day = Math.floor(Math.random() * 28) + 1;
const monthStr = month.toString().padStart(2, '0');
const dayStr = day.toString().padStart(2, '0');
prop.propertyData.lastMajorRenovationDate = `${year}-${monthStr}-${dayStr}`;
prop.propertyData.recentMajorRepairs = "Full Interior & Exterior Renovation";
prop.propertyData.renovationDescription = "Modernized kitchen, new flooring, fresh paint, roof inspection";
}
});
return allProperties; return allProperties;
} }