How come this test I wrote fails in jodatime 1.6.2? Is it a bug?
@Test
public void testIfJodaTimePeriodsHandlesPeriodTypesOtherThanMinutesAndHours() {
long twentyDaysInMillis = TimeUnit.MILLISECONDS.convert(20, TimeUnit.DAYS);
Period twoWeeks = new Period(twentyDaysInMillis, PeriodType.weeks());
Assert.assertEquals(2, twoWeeks.getWeeks());
// twoWeeks.getWeeks() actually returns 0!!
}
FYI, Periods with all PeriodTypes only fills in the fields for minutes and hours, even if the millis passed to the constructor amounts to more than 25 hours. This is counterintuitive.