From eb96f8e7f2002fd497ebff22445a2cdbe17e322c Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 7 Jun 2026 10:28:34 +0100 Subject: [PATCH] Fix fiscal year end use in gnc-period-select When saving the 'fy_end' date in the GncPeriodSelect widget the year was being saved as G_DATE_BAD_YEAR. In doing so, the month and day when retrieved will be 0. If the year is set separately with g_date_set_year and G_DATE_BAD_YEAR is used the following error is logged... ERROR g_date_set_year: assertion 'g_date_valid_year (y)' failed So to fix this just copy the incoming 'fy_end' GDate. --- gnucash/gnome-utils/gnc-period-select.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gnucash/gnome-utils/gnc-period-select.c b/gnucash/gnome-utils/gnc-period-select.c index 1d5b8be645..98708d2b27 100644 --- a/gnucash/gnome-utils/gnc-period-select.c +++ b/gnucash/gnome-utils/gnc-period-select.c @@ -270,9 +270,7 @@ gnc_period_select_set_fy_end (GncPeriodSelect *period, const GDate *fy_end) if (fy_end) { - period->fy_end = g_date_new_dmy(g_date_get_day(fy_end), - g_date_get_month(fy_end), - G_DATE_BAD_YEAR); + period->fy_end = g_date_copy (fy_end); } else {