public void plusMonths ( int delta ) { if ( delta != 0 ) { int result = getMonth ( ) - 1 + delta ; setMonth ( Math . floorMod ( result , 12 ) + 1 ) ; plusYears ( Math . floorDiv ( result , 12 ) ) ; } }
Adds delta months . Delta can be negative . Month and year fields are affected .