Under juvenile court wardship proceedings, the court may elect to aggregate the period of physical confinement on multiple counts or multiple petitions, including previously sustained petitions, and if it so chooses to do so, it must also aggregate the predisposition custody credits attributable to those petitions. The juvenile court set minor’s maximum period of confinement at three years and eight months, aggregating two petitions but did not aggregate the custody credits for both petitions. Initially, the appellate court determined that minor’s petition addressing credits was not moot regardless of the expiration of minor’s camp commitment because his maximum period of confinement had not expired. The court then held that pursuant to In re Eric J. (1979) 25 Cal.3d 522, when a juvenile court elects to aggregate a minors period of physical confinement on multiple petitions, the court must also aggregate the predisposition custody credits attributable to those multiple petitions. Accordingly, the presentence credit award was modified to reflect all the relevant periods of confinement served for each petition.