
3 Cal.App.4th 1109 (1992)
6 Cal. Rptr.2d 25
In re JOHN H., a Person Coming Under the Juvenile Court Law.
THE PEOPLE, Plaintiff and Respondent,
v.
JOHN H., Defendant and Appellant.
Docket No. C011865.
Court of Appeals of California, Third District.
February 19, 1992.
*1110 COUNSEL
Mark E. Cutler and Steven Meinrath, under appointments by the Court of Appeal, for Defendant and Appellant.
Daniel E. Lungren, Attorney General, George Williamson, Chief Assistant Attorney General, Robert R. Anderson, Acting Assistant Attorney General, Michael J. Weinberger and Thomas Y. Shigemoto, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
SIMS, J.
The juvenile court found John, a minor, had committed robbery (Pen. Code, § 211) and had conspired to commit robbery (Pen. Code, §§ 182, *1111 211) and sustained the allegations of a wardship petition. (Welf. & Inst. Code, § 602.)[1] The court committed John to the California Youth Authority (CYA), credited him with 40 days of predisposition custody and imposed a restitution fine of $100 and restitution to John's victim of $17.83.
John contends the court either failed to calculate or incorrectly calculated the number of days he was in custody prior to the disposition hearing and that the court should have subtracted the amount of the restitution owed the victim from the other restitution fine. We agree with the first contention but not the second. The facts of the crimes are irrelevant to the issues on appeal and therefore will not be described here.

I. Custody credits

(1) A minor is entitled to credit against his or her maximum term of CYA confinement for time spent in custody prior to the disposition hearing. (Pen. Code, § 2900.5, subd. (a); In re Eric J. (1979) 25 Cal.3d 522, 533-536 [159 Cal. Rptr. 317, 601 P.2d 549]; In re Gustavo M. (1989) 214 Cal. App.3d 1485, 1500 [263 Cal. Rptr. 328].) It is the court's duty to calculate the number of days earned and the court may not delegate that duty. (Pen. Code, § 2900.5, subd. (d); People v. Vargas (1988) 204 Cal. App.3d 1455, 1469, fn. 9 [251 Cal. Rptr. 904]; In re Allen (1980) 105 Cal. App.3d 310, 314-315 [164 Cal. Rptr. 319].)
John first points out that at the disposition hearing the court initially awarded 36 days of credit but then retracted that finding and stated the Probation Department or CYA would calculate the final figure. John correctly contends this was error.
The People note the court's commitment order granted John 40 days of credit and contend this resolves the issue. John, however, points out he was ordered detained on June 6, 1991, and ordered committed on August 16, a period of 72 days. He therefore asserts the court's calculation, if one was made, was erroneous.
The People do not address John's contention he was in custody from June 6 until August 16. Instead they assert he incorrectly seeks credit for a prior period of home detention and that there is no prejudice in any event because the CYA ultimately determines a juvenile's total period of confinement.
The People's first contention is simply wrong. John's opening brief clearly states credit is sought for the June 6 to August 16 "period of 72 days" and *1112 asks this court to correct the judgment "to provide appellant with 72 days of custody credit."
The People's second contention is correct but irrelevant. The juvenile court determines the maximum period for which a minor may be confined but the CYA decides whether to release the juvenile before that period expires. (§§ 726, 1766; Cal. Rules of Court, rule 1494(b); In re James A. (1980) 101 Cal. App.3d 332, 337-338 [161 Cal. Rptr. 588].)
The CYA may not confine a juvenile longer than the period for which an adult could be imprisoned for the same offenses which the juvenile committed. (§§ 726, 1766.) It is for this reason that the court must inform the CYA of the length of the minor's predisposition detention. (Eric J., supra, 25 Cal.3d at p. 536.) Thus the fact the CYA ultimately determines when to release the minor in no way relieves the juvenile court of its duty to calculate the period of precommitment custody.
The People have offered neither facts from the record nor any arguments refuting John's contention he was in custody because of the charges in this case from June 6 until August 16. John is therefore entitled to 72 days of credit for that period.

II. Restitution and fine

Section 730.6 requires the juvenile court to impose a "restitution fine" of up to $1,000 when a minor is made a ward of the court under section 602 for committing a felony. Section 731.1 permits the court to order the minor to pay restitution to the crime's victim "in lieu of ... all or a portion of the restitution fine required by Section 730.6" in cases in which the victim has suffered an economic loss. (§ 731.1, subd. (a).)
(2) John contends the court erred by failing to subtract the amount ordered as victim restitution, $17.83, from the fine imposed under section 730.6, $100, as required by section 731.1. John waived this contention by failing to raise it below. (See People v. Walker (1991) 54 Cal.3d 1013, 1023 [1 Cal. Rptr.2d 902, 819 P.2d 861].) Had John objected when the judgment was pronounced the juvenile court could have easily cured any error by either subtracting the victim restitution from the fine or stating it intended to impose an aggregate fine of $117.83, which it was authorized to do. Any error is therefore waived.
The judgment (order) is modified in part and affirmed in part. The commitment order is modified to award John 72 days of predisposition *1113 custody. In all other respects the order is affirmed. The juvenile court is to prepare an amended commitment order and to forward a certified copy to the CYA.
Blease, Acting P.J., and Scotland, J., concurred.
NOTES
[1]  All statutory references are to the Welfare and Institutions Code unless otherwise indicated.
