So let's take this case by case.
First, let's take the case where the right endpoint of the interval is in $[0,2]$ but not the left one.
so $x-1<0<x<2$. That amounts to $0<x<1$.
In that case, we can split up the integral as $\int_{x-1}^0+\int_0^x$.
What will happen to the integrand over the first part of the integral, though?