But legislation requires parents to be given at least 24 hours' notice in writing of any detention that will take place ...