Skip to content

Commit a915124

Browse files
committed
Update internal to avoid precision destruction
1 parent 5529360 commit a915124

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/test.el

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
(should (equal (floor (ts-unix (ts-now)))
8080
(string-to-number (format-time-string "%s")))))
8181

82+
(ert-deftest ts-internal ()
83+
(should (and (consp (ts-internal (ts-now)))
84+
(not (proper-list-p (ts-internal (ts-now)))))))
85+
8286
;;;;; Adjustors
8387

8488
;;;;;; Non-destructive

ts.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ slot `year' and alias `y' would create an alias `ts-y')."
222222
;; MAYBE: Add tz-offset-minutes
223223

224224
(internal
225-
nil :accessor-init (apply #'encode-time (decode-time (ts-unix struct))))
225+
nil :accessor-init (funcall #'time-convert (ts-unix struct) t))
226226
(unix
227227
nil :accessor-init (pcase-let* (((cl-struct ts second minute hour day month year) struct))
228228
(if (and second minute hour day month year)

0 commit comments

Comments
 (0)