How to get corresponding quarter of previous year in Scala

I have a date string with me in the format – “20202” [“yyyyQ”]. Is there a way to get the corresponding quarter of previous year ? ex- for 20202 , it should be 20192