They assign it at the beginning of a pairing, if it fits into your FDP on the last day, unfortunately it's legal. Just make sure your getting credit for the flying, and your ready reserve shift you do. If ready is assigned after a flight assignment you are credited for both.