recordexpungPDX icon indicating copy to clipboard operation
recordexpungPDX copied to clipboard

Fix the leap day bug

Open wittejm opened this issue 4 years ago • 1 comments

This task is done when:

  • We determine expected behavior of the app relative to any date in the future (for example, what is the date of eligibility three years after a leap day 2/29?)
  • We write unit tests to check for correctness
  • We handle these not-yet-clarified edge cases in the time analysis.

An example snippet to compare against the relative dates computed with month-offsets instead of day-offsets (which is our current approach for testing.

for i in range(365):
    if date.today() + relativedelta(days=i)  +relativedelta(years=-3) + relativedelta(months=1) + relativedelta(years=3) != date.today() + relativedelta(days=i) + relativedelta(months=1): print(date.today() + relativedelta(i))

wittejm avatar Feb 28 '20 23:02 wittejm