If you schedule a c section

How long will your doctor let you go before the schedule it? A week before? On your due date?