gnucash stable: gnc_relative_date_to_time64: Have only if statemen for period TODAY.

John Ralls jralls at code.gnucash.org
Tue Mar 25 16:24:21 EDT 2025


Updated	 via  https://github.com/Gnucash/gnucash/commit/6712a4a5 (commit)
	from  https://github.com/Gnucash/gnucash/commit/ad92ae41 (commit)



commit 6712a4a5fbf60ae125dbcbcc1b20f89d422c9cdc
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Mar 25 13:24:06 2025 -0700

    gnc_relative_date_to_time64: Have only if statemen for period TODAY.

diff --git a/libgnucash/engine/gnc-option-date.cpp b/libgnucash/engine/gnc-option-date.cpp
index d5c0e104c0..3b47c7d5a1 100644
--- a/libgnucash/engine/gnc-option-date.cpp
+++ b/libgnucash/engine/gnc-option-date.cpp
@@ -519,14 +519,12 @@ time64
 gnc_relative_date_to_time64(RelativeDatePeriod period, time64 now_t)
 {
     if (period == RelativeDatePeriod::TODAY)
-        return static_cast<time64>(GncDateTime());
+        return now_t;
     if (period == RelativeDatePeriod::START_ACCOUNTING_PERIOD)
         return gnc_accounting_period_fiscal_start();
     if (period == RelativeDatePeriod::END_ACCOUNTING_PERIOD)
         return gnc_accounting_period_fiscal_end();
 
-    if (period == RelativeDatePeriod::TODAY)
-        return now_t;
     auto now{static_cast<tm>(GncDateTime(now_t))};
     struct tm acct_per =
         static_cast<tm>(GncDateTime(gnc_accounting_period_fiscal_start()));



Summary of changes:
 libgnucash/engine/gnc-option-date.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)



More information about the gnucash-changes mailing list