Bug 798946 - start/end of current/last quarter have off-by-one error

Calculating the quarter offset when the current month is less than the
beginning month of the fiscal year was inverted.
This commit is contained in:
John Ralls 2024-02-17 12:47:04 -08:00
parent f5b7bf3401
commit 266ae2a931

View File

@ -529,8 +529,8 @@ gnc_relative_date_to_time64(RelativeDatePeriod period)
case RelativeDateOffset::QUARTER:
{
auto delta = (now.tm_mon > acct_per.tm_mon ?
now.tm_mon - acct_per.tm_mon :
acct_per.tm_mon - now.tm_mon) % 3;
( now.tm_mon - acct_per.tm_mon) % 3 :
3 - ((acct_per.tm_mon - now.tm_mon) % 3));
now.tm_mon = now.tm_mon - delta;
}
[[fallthrough]];