This is speculative, but I'd guess that the deal in principle announced on Tuesday, August 18th probably came together on the weekend before, as the two parties pressed to see what were key demands and what they were prepared to live with.
As I understand it, these sort of negotiations mostly come to a resolution as the deadline approaches and the risk of no agreement increases.