If I'm not mistaken, the start of the league year is when teams have to be compliant, and calculations are done at league offices. Not sure the exact date this year, but usually in late march.
I don't believe they are required to be "under the cap" to franchise a player, or even offer a new contract for that matter, but they will have to make other moves by the start of the new league year.
This may seem unfair, but I'm not sure how you would do it otherwise. If teams had to be under the cap on a daily basis it would severely limit what they could do in the offseason.