Skip to content

Commit

Permalink
Bug 798946 - start/end of current/last quarter have off-by-one error
Browse files Browse the repository at this point in the history
Calculating the quarter offset when the current month is less than the
beginning month of the fiscal year was inverted.
  • Loading branch information
jralls committed Feb 17, 2024
1 parent f5b7bf3 commit 266ae2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libgnucash/engine/gnc-option-date.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]];
Expand Down

0 comments on commit 266ae2a

Please sign in to comment.