(v) placed in detention for a period not to exceed 30 days, either as the exclusive order of disposition or, where appropriate, in conjunction with any other order of disposition issued under this paragraph, provided that any such detention shall be in a juvenile detention home and the minor so detained shall be 10 years of age or older. However, the 30-day limitation may be extended by further order of the court for a minor under age 15 committed to the Department of Children and Family Services if the court finds that the minor is a danger to the minor or others. The minor shall be given credit on the sentencing order of detention for time spent in detention under Sections 5-501, 5-601, 5-710, or 5-720 of this Article as a result of the offense for which the sentencing order was imposed. The court may grant credit on a sentencing order of detention entered under a violation of probation or violation of conditional discharge under Section 5-720 of this Article for time spent in detention before the filing of the petition alleging the violation. A minor shall not be deprived of credit for time spent in detention before the filing of a violation of probation or conditional discharge alleging the same or related act or acts. The limitation that the minor shall only be placed in a juvenile detention home does not apply as follows: Persons 18 years of age and older who have a petition of delinquency filed against them may be confined in an adult detention facility. In making a determination whether to confine a person 18 years of age or older who has a petition of delinquency filed against the person, these factors, among other matters, shall be considered:
(A) the age of the person;(B) any previous delinquent or criminal history of the person;(C) any previous abuse or neglect history of the person;(D) any mental health history of the person; and(E) any educational history of the person;