Jehoiada lived after the accession of Joash at least 23 years 2 Kings 12:6. Thus the idolatries of Joash 2 Chronicles 24:18 were confined to his last 10 or 15 years.
Matthew Henry
Concise Bible Commentary
Joash is more zealous about the repair of the temple than Jehoiada himself. It is easier to build temples, than to be temples to God. But the repairing of places for public worship is a good work, which all should promote. And many a good work would be done that now lies undone, if active men would put it forward.
SDA Bible Commentary (limited)
Volume 1-7
2. All the days of Jehoiada. “All his days wherein Jehoiada the priest instructed him” (2 Kings 12:2).