Maternity leave

When do you call for your maternity leave? I plan on working up until a week before my due date.