diff --git a/src/parsers/date-format.lisp b/src/parsers/date-format.lisp index 3fc2fdf..8a31a68 100644 --- a/src/parsers/date-format.lisp +++ b/src/parsers/date-format.lisp @@ -44,7 +44,8 @@ (with-output-to-string (s) (format s "~a-~a-~a ~a:~a:~a" (let ((yint (parse-integer year))) - (if (< yint *century*) (+ *century* yint) yint)) + ;; process 2-digits year formats specially + (if (<= (length year) 2) (+ *century* yint) yint)) month day (let ((hint (parse-integer hour))) diff --git a/src/sources/common/project-fields.lisp b/src/sources/common/project-fields.lisp index 1e7fa57..7069c11 100644 --- a/src/sources/common/project-fields.lisp +++ b/src/sources/common/project-fields.lisp @@ -41,7 +41,6 @@ (list (cdr field-name-or-list)) (t (cdr (assoc field-name-or-list fields :test #'string-equal)))) - (declare (ignore date-format)) ; TODO ;; now prepare a function of a column (lambda (col) (let ((value-or-null diff --git a/test/csv-parse-date.load b/test/csv-parse-date.load index fee2d28..72184e5 100644 --- a/test/csv-parse-date.load +++ b/test/csv-parse-date.load @@ -19,6 +19,6 @@ LOAD CSV ); $$; -1,2014-10-02 00-33-12.123456 +1,1999-10-02 00-33-12.123456 2,2014-10-02 00-33-13.123456 3,2014-10-02 00-33-14.123456