X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Ftime.lisp;h=c5e78a6738bc7d64122b468b653afe690d24ad3f;hp=8d0684658825b56e5ba37a316b36624fbcdb8e46;hb=e622ee6f4bf2b9fe81af59d566e651c983a4833b;hpb=8a8ee2d7d791b7a3efaed06420802a925d16fca3 diff --git a/sql/time.lisp b/sql/time.lisp index 8d06846..c5e78a6 100644 --- a/sql/time.lisp +++ b/sql/time.lisp @@ -1013,20 +1013,22 @@ rules" ;; ------------------------------------------------------------ ;; Parsing iso-8601 timestrings -(define-condition iso-8601-syntax-error (error) +(define-condition iso-8601-syntax-error (sql-user-error) ((bad-component;; year, month whatever :initarg :bad-component - :reader bad-component))) + :reader bad-component)) + (:report (lambda (c stream) + (format stream "Bad component: ~A " (bad-component c))))) (defun parse-timestring (timestring &key (start 0) end junk-allowed) "parse a timestring and return the corresponding wall-time. If the timestring starts with P, read a duration; otherwise read an ISO 8601 formatted date string." - (declare (ignore junk-allowed)) ;; FIXME + (declare (ignore junk-allowed)) (let ((string (subseq timestring start end))) (if (char= (aref string 0) #\P) - (parse-iso-8601-duration string) - (parse-iso-8601-time string)))) + (parse-iso-8601-duration string) + (parse-iso-8601-time string)))) (defvar *iso-8601-duration-delimiters* '((#\D . :days)