
87 Cal.Rptr.2d 870 (1999)
74 Cal.App.4th 393
DAWNEL D., Petitioner,
v.
The SUPERIOR COURT of Orange County, Respondent;
Orange County Social Services Agency et al., Real Parties In Interest.
No. G025109.
Court of Appeal, Fourth District, Division Three.
August 19, 1999.
*871 Carl C. Holmes, Public Defender, Marri Derby and Paul T. DeQuattro, Deputy Public Defenders, for Petitioner.
Laurence M. Watson, County Counsel, and Ward Brady, Deputy County Counsel, for Real Party in Interest Orange County Social Services Agency.
Janice J. Doezie, Orange, for Real Parties in Interest David and Wendy D.
Harold T. LaFlamme and Craig E. Arthur for the Minor.

OPINION
CROSBY, Acting P.J.
Dawnel D. petitions for extraordinary relief from Orange County Juvenile Court orders terminating reunification services at the six-month review hearing and scheduling a Welfare and Institutions Code section 366.26 permanency hearing for her daughter Mollie.[1] She contends the court abused its discretion when it terminated reunification services after only six months because she regularly participated in court-ordered reunification services. She also argues, correctly we think, that the court examined the wrong time frame when it determined there was no substantial probability she would reunify with Mollie. Finally, she claims termination of services after only six months violated her substantive due process right to parent.
While we are not persuaded by Dawnel's first and third contentions, we agree the court based its determination regarding the probability of reunification on too short a time period. Consequently, we direct issuance of a writ of mandate directing the court to reexamine the likelihood of reunification.

I
Mollie was born addicted to amphetamines on June 10, 1998. At the time of her daughter's birth, Dawnel tested positive for both amphetamines and tetrahydrocannabinol (THC), a chemical found in marijuana. On June 16, Mollie was ordered detained by the juvenile court.
On July 14, both parents pleaded no contest to a petition alleging Mollie came *872 within the juvenile court's jurisdiction because of the risk posed by her parents' substance abuse.[2] The contested dispositional hearing was continued several times and did not occur until September 1998.
The court placed Mollie in an out-of-home placement and adopted a reunification plan for Dawnel. The plan required her to successfully complete a parenting education class, individual counseling to address issues of victimization and ability to protect herself,[3] and most importantly a substance abuse rehabilitation program that included twice weekly random drug testing. The plan expressly noted that missed drug tests would be considered positive. The court also ordered weekly monitored visitation. The matter was set for a six-month review hearing in March 1999 pursuant to section 366.21, subdivision (e).
Dawnel maintained regular visitation with her daughter until she moved to Reno. She was unable to comfort her daughter when she cried on later visits, seemed uncomfortable with the baby, and became easily frustrated.
Dawnel made an appointment to enter rehabilitation and began testing for drugs. Initial drug tests were negative, but in July she tested positive for THC and amphetamines. After moving Dawnel began drug counseling and attended meetings through the Committee to Aid Abused Women (CAW). As of the September 2 update report, she had yet to submit to any drug tests in Nevada.
After disposition Dawnel sporadically complied with her reunification plan. She was discharged from her first rehabilitation program on December 24 for failure to comply with attendance requirements and pay for services. She tested irregularly and was positive for THC in October and February.
As of January 1999, Dawnel had not received her certificate of completion for parenting class because of nonpayment and failure to complete a homework assignment. She attended only three counseling sessions with her individual therapist. But she continued to go to battered women meetings. In addition, she maintained full-time employment. However, she used her work schedule as an excuse for her failure to regularly visit Mollie. Although the foster parents arranged to transport Mollie halfway to Dawnel's home for visits, Dawnel did not appear, purportedly because of work requirements.
Dawnel admitted she used marijuana in early February, but claimed she soon stopped. She told the social worker she started a new substance abuse rehabilitation program.
In spite of Dawnel's sporadic participation, the social worker recommended an additional period of reunification services. Mollie's counsel, however, objected to further services; and a contested hearing occurred on April 1.
During argument the court asked what period of time it should examine to determine whether there was a substantial probability Dawnel would reunify with Mollie if more services were provided. The court was concerned whether the limitations on the time period for services contained in section 361.5, subdivision (a) also limited the time frame it considered when it determined pursuant to subdivision (e) of section 366.21 whether there was a substantial probability Dawnel would reunify with Mollie within six months.
*873 The court ultimately looked only at the time remaining before the 12-month review hearing had to be scheduled. It concluded there was not a substantial probability Dawnel would reunify with Mollie by that date. The judge also found, by clear and convincing evidence, it would be detrimental to return Mollie to Dawnel's custody and that the mother had failed to regularly participate in court-ordered services. The court terminated reunification services and scheduled a section 366.26 permanency hearing for July 30.

II
Dawnel argues the court abused its discretion when it terminated services at six months. She says she regularly participated in her reunification plan and should not be held to a standard of perfect compliance to meet the regular participation standard. While we agree Dawnel was not required to demonstrate perfect compliance under the statute, we disagree that her participation met the appropriate standard or that the court misapplied the standard.
The relevant portion of subdivision (e) of section 366.21 provides, "At the review hearing held six months after the initial dispositional hearing, the court shall order the return of the child to the physical custody of his or her parent ... unless the court finds, by a preponderance of the evidence, that the return of the child to his or her parent ... would create a substantial risk of detriment to the safety, protection, or physical or emotional well-being of the child.... [¶] ... [¶] If the child was under the age of three years on the date of the initial removal and the court finds by clear and convincing evidence that the parent failed to participate regularly in any court-ordered treatment plan, the court may schedule a hearing pursuant to Section 366.26 within 120 days."
Dawnel argues that under this provision the court lacked discretion to terminate services and schedule a section 366.26 hearing because she regularly complied with the reunification plan. (See Miguel V. v. Superior Court[*] (Cal.App.).) In support of her position, she points to her consistent participation in battered women groups, her completion of a parenting class, and her re-enrollment in substance abuse rehabilitation. As the trial court emphasized, however, the real problem in this case was substance abuse. While Dawnel did participate in some services, she failed in her participation in the rehabilitation component of her plan. She tested positive for THC and amphetamines throughout the nearly nine months between the detention hearing and the sixmonth review hearing. Moreover, she did not test according to the schedule. Such a dismal performance in the most crucial aspect of the reunification plan can hardly be viewed as regular participation in services. Substantial evidence supports the court's finding regarding Dawnel's noncompliance with the plan.

III
Dawnel next contends the court should have extended services regardless of the quality of her participation in the reunification plan because the evidence demonstrated there was a substantial probability Mollie would be returned to her custody in six months. She argues the court erroneously considered a shorter period, i.e., by the date the 12-month review hearing was required to be set, rather than within a full 6-month period. If the court had examined the proper period of time, she claims it would have concluded a substantial probability of reunification did exist. She argues we must therefore issue a writ directing the juvenile court to order more reunification services. We agree with her interpretation of the statutory requirements. We do not, however, concur that we must direct the court to offer more services.
At the six-month review hearing for a child who was under the age of three when she was initially removed from her parent's *874 custody, the court must determine if "there is a substantial probability that the child ... may be returned to his or her parent ... within six months ...." (§ 366.21, subd. (e).) If the court finds such a probability exists, it must order an additional period of services and schedule a 12-month review hearing. (Ibid.) In scheduling the 12-month review hearing, the court must consider the time limits set forth in subdivision (a) of section 361.5.
The relevant portion of subdivision (a) provides as follows: "(1) For a child who, on the date of the initial removal from the physical custody of his or her parent, ... was three years of age or older, court-ordered services shall not exceed a period of 12 months from the date the child entered foster care. [¶] (2) For a child who, on the date of the initial removal from the physical custody of his or her parent, ... was under the age of three years, court-ordered services shall not exceed a period of six months from the date the child entered foster care, [¶] Regardless of the age of the child, a child shall be deemed to have entered foster care on the earlier of the date of the jurisdictional hearing held pursuant to Section 356 or the date that is 60 days after the date on which the child was initially removed from the physical custody of his or her parent.... [¶] Notwithstanding paragraphs (1) and (2), court-ordered services may be extended up to a maximum time period not to exceed 18 months after the date the child was originally removed from physical custody of his or her parent ... if it can be shown, at the hearing held pursuant to subdivision (f) of Section 366.21, that the permanent plan for the child is that he or she will be returned and safely maintained within the home in the extended time period." (§ 361.5, subd. (a).)
The court, the Orange County Social Services Agency (SSA)[4] and Mollie's counsel correctly calculated the last day for the 12-month review was July 14, 1999, 12 months from the date of the jurisdictional hearing. Because more than 60 days did not elapse between the date of detention and the date of the jurisdictional hearing, the date of the jurisdictional hearing controls the calculation of the review hearing dates per section 361.5, subdivision (a)(2).
This conclusion, however, does not end our inquiry. Section 366.21, subdivision (e) expressly requires the court to determine whether "there is a substantial probability that the child ... may be returned to his or her parent within six months." (Italics added.) If the court concludes such a probability exists, it "shall continue the case to the 12-month permanency hearing." (Ibid.) We conclude the plain language of the statute demonstrates the Legislature's intent that the court look at a full six-month period, regardless of when the twelve-month period would expire in a particular case, when it makes that determination.
Contrary to the position taken by Mollie's counsel and the court, such a conclusion is consistent with section 361.5, subdivision (a), which permits a total of 18 months of services after the date the child was first removed from her parent's custody. Although the 12-month review hearing may have to be set before completion of the 6-month period contemplated by section 366.21, subdivision (e), there may be time left beyond the 12-month date in the maximum 18-month period. That is exactly what happened here. Although the 12-month period lapsed on July 14, 1999, the 18-month period extends roughly to December 16,1999.
Dawnel argues the evidence would support a finding of a substantial probability of reunification considering the correct time frame. She concludes we must direct *875 the juvenile court to order an additional period of services. We disagree.
The court abused its discretion by failing to exercise it, not by ignoring the facts. As noted in the discussion regarding Dawnel's participation in services, she continued to use drugs a little over a month before the six-month review hearing occurred. At that time she had yet to commit herself to a rehabilitation program. A judge is not required to indulge in what appear to be idle acts.
We only direct the court to conduct another hearing pursuant to section 366.21, subdivision (e) where all these facts (and any relevant subsequent events) will be considered within the relevant chronological context. Because substantial evidence supports the finding Dawnel had not regularly participated in the court-ordered plan, and because she does not challenge any other essential finding, the court should limit itself to reconsideration of the substantial probability issue.[5] If the court determines more services should be offered, the hearing pursuant to section 366.21, subdivisions (f) and (g), shall be scheduled without counting the time passed during the proceedings in this court.

IV
Let a peremptory writ of mandate issue directing the juvenile court to vacate its April 1, 1999 orders terminating reunification services and setting a section 366.26 permanency hearing and schedule a new hearing pursuant to section 366.21, subdivision (e) to be conducted consistent with the views expressed above. All findings except those regarding a substantial probability of return are unaffected by this decision and remain intact. This opinion is final 10 days after filing pursuant to rule 24(d) of the California Rules of Court, and our stay of the section 366.26 hearing is vacated at that time.
RYLAARSDAM, J., and BEDSWORTH, J., concur.
NOTES
[1]  All statutory references are to the Welfare and Institutions Code.
[2]  Mollie's father, Steve S., has not petitioned for writ relief.
[3]  Steve had been physically abusive in a previous relationship, but Dawnel denied he abused her. The maternal grandmother, however, reported there was at least one incident of domestic violence between Dawnel and Steve that resulted in his arrest. In any event, Dawnel did not object to the requirement that she address issues related to domestic violence.
[*]  Reporter's Note: Opinion G024940 deleted upon direction of Supreme Court by order dated September 15, 1999.
[4]  SSA recommended an additional period of reunification services regardless of how the court calculated the time period. In this writ proceeding, SSA has declined to take a position. It filed a letter acknowledging its view in the trial court but recognizing substantial evidence supported the court's ruling.
[5]  Because our decision on this issue is dispositive, we need not address Dawnel's contention that she was deprived of due process by termination of services at six months. The issue may become moot if the court orders more services.
