Spaces:
Running
Running
the dates are showing the day before. Please fix to show as Eastern Daylight time - Follow Up Deployment
Browse files- index.html +41 -1
index.html
CHANGED
|
@@ -133,6 +133,10 @@
|
|
| 133 |
<option value="selfGen">Self Gen (1.00%)</option>
|
| 134 |
</select>
|
| 135 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
<div class="flex items-end">
|
| 137 |
<button type="submit" class="w-full bg-indigo-600 text-white px-4 py-2 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition">
|
| 138 |
<i class="fas fa-plus mr-2"></i>Add Client
|
|
@@ -160,6 +164,7 @@
|
|
| 160 |
<thead class="bg-gray-50">
|
| 161 |
<tr>
|
| 162 |
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Client</th>
|
|
|
|
| 163 |
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Loan Amount</th>
|
| 164 |
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Points Charged</th>
|
| 165 |
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Lender Price</th>
|
|
@@ -253,6 +258,18 @@
|
|
| 253 |
break;
|
| 254 |
}
|
| 255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
// Format currency
|
| 257 |
const formatCurrency = (value) => {
|
| 258 |
return new Intl.NumberFormat('en-US', {
|
|
@@ -281,6 +298,7 @@
|
|
| 281 |
|
| 282 |
row.innerHTML = `
|
| 283 |
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${client.clientName}</td>
|
|
|
|
| 284 |
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatCurrency(client.loanAmount)}</td>
|
| 285 |
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatPercentage(client.pointsCharged)}</td>
|
| 286 |
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatPercentage(client.lenderPrice)}</td>
|
|
@@ -321,8 +339,27 @@
|
|
| 321 |
updateSummary();
|
| 322 |
}
|
| 323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
// Update summary statistics
|
| 325 |
function updateSummary() {
|
|
|
|
|
|
|
| 326 |
if (clients.length === 0) {
|
| 327 |
avgLoanAmountEl.textContent = '$0';
|
| 328 |
totalLoanAmountEl.textContent = '$0';
|
|
@@ -401,6 +438,7 @@
|
|
| 401 |
const pointsCharged = parseFloat(document.getElementById('pointsCharged').value);
|
| 402 |
const lenderPrice = parseFloat(document.getElementById('lenderPrice').value);
|
| 403 |
const compTier = document.getElementById('compTier').value;
|
|
|
|
| 404 |
|
| 405 |
// Note: Calculated price will be capped at 2.75% in display
|
| 406 |
|
|
@@ -409,7 +447,8 @@
|
|
| 409 |
loanAmount,
|
| 410 |
pointsCharged,
|
| 411 |
lenderPrice,
|
| 412 |
-
compTier
|
|
|
|
| 413 |
};
|
| 414 |
|
| 415 |
clients.push(client);
|
|
@@ -434,6 +473,7 @@
|
|
| 434 |
document.getElementById('pointsCharged').value = client.pointsCharged;
|
| 435 |
document.getElementById('lenderPrice').value = client.lenderPrice;
|
| 436 |
document.getElementById('compTier').value = client.compTier;
|
|
|
|
| 437 |
|
| 438 |
// Remove the client from the array
|
| 439 |
clients.splice(index, 1);
|
|
|
|
| 133 |
<option value="selfGen">Self Gen (1.00%)</option>
|
| 134 |
</select>
|
| 135 |
</div>
|
| 136 |
+
<div>
|
| 137 |
+
<label for="closingDate" class="block text-sm font-medium text-gray-700 mb-1">Closing Date</label>
|
| 138 |
+
<input type="date" id="closingDate" required class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
| 139 |
+
</div>
|
| 140 |
<div class="flex items-end">
|
| 141 |
<button type="submit" class="w-full bg-indigo-600 text-white px-4 py-2 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition">
|
| 142 |
<i class="fas fa-plus mr-2"></i>Add Client
|
|
|
|
| 164 |
<thead class="bg-gray-50">
|
| 165 |
<tr>
|
| 166 |
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Client</th>
|
| 167 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Closing Date</th>
|
| 168 |
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Loan Amount</th>
|
| 169 |
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Points Charged</th>
|
| 170 |
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Lender Price</th>
|
|
|
|
| 258 |
break;
|
| 259 |
}
|
| 260 |
|
| 261 |
+
// Format date in Detroit time
|
| 262 |
+
const formatDetroitDate = (dateString) => {
|
| 263 |
+
// Add 'T00:00:00' to ensure it's treated as midnight in Detroit timezone
|
| 264 |
+
const date = new Date(dateString + 'T00:00:00');
|
| 265 |
+
return date.toLocaleDateString('en-US', {
|
| 266 |
+
timeZone: 'America/Detroit',
|
| 267 |
+
year: 'numeric',
|
| 268 |
+
month: '2-digit',
|
| 269 |
+
day: '2-digit'
|
| 270 |
+
});
|
| 271 |
+
};
|
| 272 |
+
|
| 273 |
// Format currency
|
| 274 |
const formatCurrency = (value) => {
|
| 275 |
return new Intl.NumberFormat('en-US', {
|
|
|
|
| 298 |
|
| 299 |
row.innerHTML = `
|
| 300 |
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">${client.clientName}</td>
|
| 301 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatDetroitDate(client.closingDate)}</td>
|
| 302 |
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatCurrency(client.loanAmount)}</td>
|
| 303 |
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatPercentage(client.pointsCharged)}</td>
|
| 304 |
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatPercentage(client.lenderPrice)}</td>
|
|
|
|
| 339 |
updateSummary();
|
| 340 |
}
|
| 341 |
|
| 342 |
+
// Group clients by month
|
| 343 |
+
function groupClientsByMonth() {
|
| 344 |
+
const months = {};
|
| 345 |
+
|
| 346 |
+
clients.forEach(client => {
|
| 347 |
+
const date = new Date(client.closingDate);
|
| 348 |
+
const monthYear = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`;
|
| 349 |
+
|
| 350 |
+
if (!months[monthYear]) {
|
| 351 |
+
months[monthYear] = [];
|
| 352 |
+
}
|
| 353 |
+
months[monthYear].push(client);
|
| 354 |
+
});
|
| 355 |
+
|
| 356 |
+
return months;
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
// Update summary statistics
|
| 360 |
function updateSummary() {
|
| 361 |
+
const months = groupClientsByMonth();
|
| 362 |
+
console.log("Clients by month:", months);
|
| 363 |
if (clients.length === 0) {
|
| 364 |
avgLoanAmountEl.textContent = '$0';
|
| 365 |
totalLoanAmountEl.textContent = '$0';
|
|
|
|
| 438 |
const pointsCharged = parseFloat(document.getElementById('pointsCharged').value);
|
| 439 |
const lenderPrice = parseFloat(document.getElementById('lenderPrice').value);
|
| 440 |
const compTier = document.getElementById('compTier').value;
|
| 441 |
+
const closingDate = document.getElementById('closingDate').value;
|
| 442 |
|
| 443 |
// Note: Calculated price will be capped at 2.75% in display
|
| 444 |
|
|
|
|
| 447 |
loanAmount,
|
| 448 |
pointsCharged,
|
| 449 |
lenderPrice,
|
| 450 |
+
compTier,
|
| 451 |
+
closingDate
|
| 452 |
};
|
| 453 |
|
| 454 |
clients.push(client);
|
|
|
|
| 473 |
document.getElementById('pointsCharged').value = client.pointsCharged;
|
| 474 |
document.getElementById('lenderPrice').value = client.lenderPrice;
|
| 475 |
document.getElementById('compTier').value = client.compTier;
|
| 476 |
+
document.getElementById('closingDate').value = client.closingDate;
|
| 477 |
|
| 478 |
// Remove the client from the array
|
| 479 |
clients.splice(index, 1);
|