mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[qif/qif-parse] restore handle non-4-digit dates, and erratum
db93aec58
contained logic error in date-handling, would invalidate
2-digit years.
Also parse-bang-field needs to trim trailing space.
This commit is contained in:
parent
08de1a0ab0
commit
6252de21fd
@ -149,7 +149,7 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define (qif-parse:parse-bang-field read-value)
|
||||
(let ((bang-field (string-downcase! (string-trim read-value))))
|
||||
(let ((bang-field (string-downcase! (string-trim-right read-value))))
|
||||
;; The QIF files output by the WWW site of Credit Lyonnais
|
||||
;; begin by: !type bank
|
||||
;; instead of: !Type:bank
|
||||
@ -235,8 +235,8 @@
|
||||
(define (date? d m y ys)
|
||||
(and (number? d) (<= 1 d 31)
|
||||
(number? m) (<= 1 m 12)
|
||||
(= 4 (string-length ys))
|
||||
(number? y) (> y 1930)))
|
||||
(number? y) (or (not (= 4 (string-length ys)))
|
||||
(> y 1930))))
|
||||
(let* ((date-parts (list (match:substring match 1)
|
||||
(match:substring match 2)
|
||||
(match:substring match 3)))
|
||||
|
@ -157,6 +157,12 @@
|
||||
"1979/03/03"
|
||||
'(d-m-y y-m-d m-d-y y-d-m)))
|
||||
|
||||
(test-equal "qif-parse:check-date-format 03/03/79"
|
||||
'(d-m-y m-d-y)
|
||||
(qif-parse:check-date-format
|
||||
"03/03/79"
|
||||
'(d-m-y y-m-d m-d-y y-d-m)))
|
||||
|
||||
(test-equal "qif-parse:check-date-format 19790303"
|
||||
'(y-m-d y-d-m)
|
||||
(qif-parse:check-date-format
|
||||
|
Loading…
Reference in New Issue
Block a user