I'm trying to work with a timeseries of monthly data. That is, there is a value for each month, and no specific date (or time) associated with it.
I could have arbitrarily fixed the day, time at some constant (eg midnight on first of the month) then used a java.util.date
or joda DateTime
but decided to try and do this within the joda type system.
My first step was to create a YearMonth
class which extends AbstractPartial
(by analogy to LocalDate
). I've now reached the next step of trying to increment a YearMonth
by a number of months. I could write the code myself (adding % 12) but I'd rather use a Joda style way of doing this.
What code should I write, and where should it live so I can for example add a 13 month or 2 year Period
to my YearMonth
class? Or am I going down a bad track?