Skip to content
Permalink
Browse files

Error in calculating the next four months out

there was a logic error in how we look ahead from the current date.
Instead of looking ahead the number of days that exist in the CURRENT
month, we need to look ahead the number of days in NEXT month. This
generally is only an issue when calculating the allocations at the
end of months, in which the following month has fewer days then the
current month.  For example, if we run the code to calculcate the
heat maps on the 31st of March, we would end up skipping April, because
31 days after March 31st becomes April 1, and that would be foolish.

Fixes: #308

Change-Id: I6132a4b36e4f4cb45fb903dca8c6a5881aa42971
  • Loading branch information
kambiz-aghaiepour committed Jan 31, 2020
1 parent 596e04d commit b624aeab817fc85f638ff5cfaec8cffafb1bcb0c
Showing with 1 addition and 1 deletion.
  1. +1 −1 quads/tools/simple_table_web.py
@@ -15,7 +15,7 @@ def main():

for i in range(months_out):
previous = dates[i]
next_date = previous + timedelta(calendar.mdays[previous.month])
next_date = previous + timedelta(calendar.mdays[(previous.month % 12) + 1])
dates.append(next_date)

if not os.path.exists(conf["visual_web_dir"]):

0 comments on commit b624aea

Please sign in to comment.
You can’t perform that action at this time.