There are two things at play here, if the report is inclusive, we want the days to be the default number of days - 1. (7 - 1 = 6). This is what this line does.

We also want reports to end at the first complete day prior to today, so if the report is inclusive, we want the enddate to be yesterday. which is what this does: https://github.com/dimagi/dimagi-utils/pull/121/files#L0R309 . If it's not an inclusive report, we're fine with the report starting at today.