Illustrative example
A tenant moves out four months before the lease ends to take a job in another state. The apartment is re-let within six weeks, and the landlord keeps billing for the whole remaining term.
Where the landlord re-rents at fair market value or at the rate agreed during the tenancy, whichever is lower, the new tenant's lease once in effect terminates the previous tenant's lease and mitigates the damages otherwise recoverable. So liability ends on the date the new lease took effect, and that date is what everything here turns on.
They agree the tenant owes the six weeks of vacancy plus the advertising actually paid for, taken from the deposit, and the balance of the deposit is returned.