Usually, three to four weeks is the minimum time. If the surgery was done within the last 6 weeks, I recommend blood thinner treatment for the prevention of blood clots. Recent surgery is a risk factor for blood clots as is prolonged sitting, and dehydration; make sure to drink water on your flight.