I am writing a program that is supposed to just calculate the months between 2 given dates and return the value to the program. For instance, if I have to calculate the numb
Joda algorithm counted correctly difference between this two dates. This pseudo-code will be the easiest way to explain how it works:
// (1)
monthsBetween(2011.6.14, 2011.4.15) = 1
monthsBetween(2011.6.15, 2011.4.15) = 2
// (2)
monthsBetween(2011.6.30, 2011.4.1) = 2
monthsBetween(2011.7.1, 2011.4.1) = 3
To do what you want you need to "improve" joda algorithm: