gnucash stable: [gnc-datetime] improve CSV date parser with ICU and boost

Christopher Lam clam at code.gnucash.org
Fri Sep 13 23:20:50 EDT 2024


Updated	 via  https://github.com/Gnucash/gnucash/commit/ab641b31 (commit)
	from  https://github.com/Gnucash/gnucash/commit/c7b55d4f (commit)



commit ab641b31f8a9c218419946930fdb651895604ddb
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Sep 2 00:21:35 2024 +0800

    [gnc-datetime] improve CSV date parser with ICU and boost
    
    1. Add dateformat "Locale" with ICU; uses current locale for date
       parsing. ICU's locale date parser may parse "3 May 2023" or
       "2024年9月13日" (LC_TIME=zh_TW.utf8) and maybe others.
    
    2. Augment d-m-y m-d-y and y-m-d with boost UK/US/ISO parsers. This allows
       CSV import of dates with months as words as "30 Sep 2023" or
       "May 4, 1978" or "2023-Dec-25". Note boost parser cannot recognise
       2-digit years, therefore "30 Sep 24" is invalid.



Summary of changes:
 libgnucash/engine/gnc-datetime.cpp            | 87 ++++++++++++++++++++++++++-
 libgnucash/engine/gnc-datetime.hpp            | 11 ++++
 libgnucash/engine/test/gtest-gnc-datetime.cpp | 38 ++++++++++++
 3 files changed, 134 insertions(+), 2 deletions(-)



More information about the gnucash-patches mailing list