(d) Any person convicted of a second violation of this Section shall be guilty of a Class 4 felony and shall serve a minimum term of imprisonment of 30 days or 300 hours of community service, as determined by the court, if:
(1) the current violation occurred when the person's driver's license was suspended or revoked for a violation of Section 11-401 or 11-501 of this Code, a similar out-of-state offense, a similar provision of a local ordinance, or a statutory summary suspension or revocation under Section 11-501.1 of this Code; and
(2) the prior conviction under this Section occurred while the person's driver's license was suspended or revoked for a violation of Section 11-401 or 11-501 of this Code, a similar out-of-state offense, a similar provision of a local ordinance, or a statutory summary suspension or revocation under Section 11-501.1 of this Code, or for a violation of Section 9-3 of the Criminal Code of 1961 or the Criminal Code of 2012, relating to the offense of reckless homicide, or a violation of subparagraph (F) of paragraph (1) of subsection (d) of Section 11-501 of this Code, relating to the offense of aggravated driving under the influence of alcohol, other drug or drugs, or intoxicating compound or compounds, or any combination thereof when the violation was a proximate cause of a death, or a similar out-of-state offense.
The court may give credit toward the fulfillment of community service hours for participation in activities and treatment as determined by court services.