Display 'Now' for soonest dates in the past

This commit is contained in:
2026-01-21 11:56:28 -07:00
parent e79f28f52b
commit 69542f08cd

View File

@ -884,7 +884,7 @@ const ApartmentDashboard = () => {
<td className="py-3 px-4 text-right font-bold text-green-600">{formatPrice(unit.currentPrice)}</td> <td className="py-3 px-4 text-right font-bold text-green-600">{formatPrice(unit.currentPrice)}</td>
<td className="py-3 px-4 text-right text-gray-500">${((unit.currentPrice || 0) / (unit.area || 1)).toFixed(2)}</td> <td className="py-3 px-4 text-right text-gray-500">${((unit.currentPrice || 0) / (unit.area || 1)).toFixed(2)}</td>
<td className="py-3 px-4 text-center">{unit.daysAvailable || 0}</td> <td className="py-3 px-4 text-center">{unit.daysAvailable || 0}</td>
<td className="py-3 px-4 text-center">{unit.soonest ? formatDate(unit.soonest) : '-'}</td> <td className="py-3 px-4 text-center">{unit.soonest ? (new Date(unit.soonest) <= new Date() ? 'Now' : formatDate(unit.soonest)) : '-'}</td>
<td className="py-3 px-4"> <td className="py-3 px-4">
<div className="flex justify-center space-x-2"> <div className="flex justify-center space-x-2">
<button <button