Yet another attempt to calculate the number of months for Statistics page monthly view

This commit is contained in:
Seeker4 2019-07-18 22:36:07 -07:00
parent 6fcc4e9af1
commit 3f42053a1d

View File

@ -1069,8 +1069,7 @@ QString Statistics::GenerateCPAPUsage()
int firstMonth = firstcpap.month();
int lastMonth = lastcpap.month();
int years = lastcpap.year() - firstcpap.year();
if (lastMonth <= firstMonth)
lastMonth += (12 * years); // handle time extending to next year
lastMonth += (12 * years); // handle time extending to next year
number_periods = lastMonth - firstMonth + 1;
if (number_periods < 1) {