From 5d1cf737df7bff11cc41ff2a822645a8a7961cf8 Mon Sep 17 00:00:00 2001 From: Sherlock <119709043+agwekixj@users.noreply.github.com> Date: Tue, 25 Feb 2025 20:17:24 -0800 Subject: [PATCH] Bug 798946 - start/end of current/last quarter have off-by-one error --- libgnucash/engine/gnc-option-date.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libgnucash/engine/gnc-option-date.cpp b/libgnucash/engine/gnc-option-date.cpp index fdf954f9a6d..7ab556ac341 100644 --- a/libgnucash/engine/gnc-option-date.cpp +++ b/libgnucash/engine/gnc-option-date.cpp @@ -524,12 +524,7 @@ gnc_relative_date_to_time64(RelativeDatePeriod period) now.tm_mon += 6; break; case RelativeDateOffset::QUARTER: - { - auto delta = (now.tm_mon >= acct_per.tm_mon ? - ( now.tm_mon - acct_per.tm_mon) % 3 : - (3 - acct_per.tm_mon - now.tm_mon) % 3); - now.tm_mon = now.tm_mon - delta; - } + now.tm_mon -= (12 + now.tm_mon - acct_per.tm_mon) % 3; [[fallthrough]]; case RelativeDateOffset::THREE: if (reldate_is_prev(period))