(a)
Except as provided in subdivision (b), unless sooner released, a minor taken into custody under the provisions of this article shall, as soon as possible but in any event before the expiration of the next judicial day after a petition to declare the minor a ward or dependent child has been filed, be brought before a judge or referee of the juvenile court for a hearing to determine whether the minor shall be further detained. Such a hearing shall be referred to as a “detention hearing.”
(b)
Whenever a minor is taken into custody without a warrant on the belief that he or she has committed a misdemeanor not involving violence, a threat of violence, or possession or use of weapons, if the minor is not currently on probation or parole, he or she shall be brought before a judge or referee of the juvenile court for a detention hearing as soon as possible, but no later than 48 hours after having been taken into custody, excluding nonjudicial days, after a petition to declare the minor a ward has been filed. In all cases involving the detention of a minor pursuant to this subdivision where the minor will not be brought before the judge or referee of the juvenile court within 24 hours, the decision not to bring the minor before the judge or referee within 24 hours shall be subject to written review and approval by a probation officer who is a supervisor as soon as possible after it is known that the minor will not be brought before the judge or referee within 24 hours. However, if the decision not to bring the minor before the judge or referee within 24 hours is made by a probation officer who is a supervisor, the decision shall not be subject to review and approval.
(c)
If the minor is not brought before a judge or referee of the juvenile court within the period prescribed by this section, he or she shall be released from custody.