From 6712a4a5fbf60ae125dbcbcc1b20f89d422c9cdc Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 25 Mar 2025 13:24:06 -0700 Subject: [PATCH] gnc_relative_date_to_time64: Have only if statemen for period TODAY. --- libgnucash/engine/gnc-option-date.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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(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(GncDateTime(now_t))}; struct tm acct_per = static_cast(GncDateTime(gnc_accounting_period_fiscal_start()));