If a commitment measure is violated the court may extend such measure for a period reasonably necessary to achieve its purpose.
If surveillance measures are violated, the court may extend them, or replace them with a commitment measure. In the latter case, the time will be reasonably established by the court but it cannot exceed the time remaining for the original measure.
In either case, extended or substituted measures cannot exceed
the time limits established in the previous Article.