gnucash maint: Bug 796785 - dates cannot be keyboard entered on vendor bill transactions

Geert Janssens gjanssens at code.gnucash.org
Thu Aug 16 09:07:53 EDT 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/44c3dc83 (commit)
	from  https://github.com/Gnucash/gnucash/commit/14335b78 (commit)



commit 44c3dc836af2c685644370a908bd8bb4388604a0
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Mon Aug 13 15:47:12 2018 +0100

    Bug 796785 - dates cannot be keyboard entered on vendor bill
     transactions
    
    Make the gncEntryLedgerModel 'get_date_help' function the same format
    as that used in the register.

diff --git a/gnucash/register/ledger-core/gncEntryLedgerModel.c b/gnucash/register/ledger-core/gncEntryLedgerModel.c
index ef47c13..f9e2737 100644
--- a/gnucash/register/ledger-core/gncEntryLedgerModel.c
+++ b/gnucash/register/ledger-core/gncEntryLedgerModel.c
@@ -569,19 +569,16 @@ static char * get_date_help (VirtualLocation virt_loc, gpointer user_data)
     GncEntryLedger *ledger = user_data;
     BasicCell *cell;
     char string[1024];
-    struct tm tm;
-    time64 tt;
+    GDate date;
 
     cell = gnc_table_get_cell (ledger->table, virt_loc);
-    if (!cell)
+    if (!cell || !cell->value || *cell->value == '\0')
         return NULL;
 
-    if (!cell->value || *cell->value == '\0')
-        return NULL;
+    g_date_clear (&date, 1);
+    gnc_date_cell_get_date_gdate ((DateCell *) cell, &date);
 
-    gnc_date_cell_get_date ((DateCell *) cell, &tt);
-    gnc_localtime_r (&tt, &tm);
-    qof_strftime (string, sizeof(string), _("%A %d %B %Y"), &tm);
+    g_date_strftime (string, sizeof (string), _("%A %d %B %Y"), &date);
 
     return g_strdup (string);
 }



Summary of changes:
 gnucash/register/ledger-core/gncEntryLedgerModel.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)



More information about the gnucash-changes mailing list