Ad
  • Custom User Avatar

    length is property, so we don't need to call it like function with ()

  • Custom User Avatar

    are you returning this?

  • Custom User Avatar

    From the kata "There are a few assumptions we will accept the year 0, even though there is no year 0 in the Gregorian Calendar."

  • Custom User Avatar

    I'm not sure that rule applies correctly to BC dates. Not having a year 0 would offset the rule by 1 year. The correction wasn't implemented in BC and therefore any testing of it for negative dates is not valid.

  • Custom User Avatar

    This is following the rules and so will not be changed.

    Leap Year Definition. A year is a leap year if it is evenly divisible by 4 but not evenly divisible by 100 unless it is also evenly divisible by 400. So 1996 was a leap year. But 1900 was not a leap year because, although it is divisible by 4, it is also divisible by 100 and not by 400. 2000 is a leap year because it is divisible by 400.

  • Default User Avatar

    Yes it's true, but this is only for this kata needs if I understand it right. Couldn't the test case for "year -300" be fixed from "365 days" to "366 days"(so the instructions) to match the real life(and exclude weird exceptions), so the code counting leap years pass the tests?

  • Custom User Avatar

    This was in the exception, Century years are NOT leap years UNLESS they can be evenly divided by 400.

  • Custom User Avatar

    Should't year -300 have 366 days in test cases? It's definitely a leap year like years 300, -304 and -296.