Skip to content

Period between years incorrect around Feb 28th/29th #224

@GoogleCodeExporter

Description

@GoogleCodeExporter
This test fails:

   [Test]
   public void BetweenLocalDates_LeapYear()
   {
       LocalDate d1 = new LocalDate(2012, 2, 29);
       LocalDate d2 = new LocalDate(2013, 2, 28);
       Assert.AreEqual(Period.FromYears(1), Period.Between(d1, d2));
       Assert.AreEqual(Period.FromMonths(-11) + Period.FromDays(-30), Period.Between(d2, d1));
   }

for a reason similar to issue 223. It gets frankly confusing to think about. 
BasicGJCalendarSystem.GetYearDifference / BasicMonthPeriodField are the 
immediate culprits, but I suspect that IslamicCalendarSystem could be 
interesting too. More tests required, probably when I'm less sleepy.

Original issue reported on code.google.com by jonathan.skeet on 11 Jun 2013 at 4:25

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions