aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-03-25 15:51:26 -0500
committerColin Okay <okay@toyful.space>2022-03-25 15:51:26 -0500
commitfabc8a7b9027ff9c312ed45591e75dfd67c21f05 (patch)
tree0d7aef241dd191d17746f8ce0fa336dc4dcca063 /lib
parente95a60bce9d86ca3b2a7cdf41a0c4df3fc5cb3fd (diff)
[add] printing creation date in oneliner printouts
Diffstat (limited to 'lib')
-rw-r--r--lib/oneliner.lisp5
-rw-r--r--lib/util.lisp7
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/oneliner.lisp b/lib/oneliner.lisp
index 668a82c..8386fa9 100644
--- a/lib/oneliner.lisp
+++ b/lib/oneliner.lisp
@@ -75,7 +75,7 @@
(let* ((title-line-format-str
(concatenate 'string "~" (prin1-to-string *term-width*) "<[~a]~;~a~;~a~>~%"))
(tags-line-format-string
- (concatenate 'string "~" (prin1-to-string *term-width*) "<~a~;by ~a~>~%")))
+ (concatenate 'string "~" (prin1-to-string *term-width*) "<~a~;by ~a ~a~>~%")))
(loop repeat *term-width* do (princ #\_))
(terpri)
(format t title-line-format-str
@@ -87,7 +87,8 @@
(equalp "manual" (oneliner-runstyle ol))))
(format t tags-line-format-string
(format nil "tags: ~{~a~^ ~}" (oneliner-tags ol))
- (oneliner-createdby ol))
+ (oneliner-createdby ol)
+ (datestring-of-universal-time (oneliner-createdat ol)))
(loop
for x from 0 to (length (oneliner-brief ol)) by *term-width*
do (format t "~a~%"
diff --git a/lib/util.lisp b/lib/util.lisp
index 4b827f1..441b2e0 100644
--- a/lib/util.lisp
+++ b/lib/util.lisp
@@ -71,6 +71,12 @@ determined by EXECUTABLE-ON-SYSTEM-P."
(if what "true" "false"))
+(defun datestring-of-universal-time (ut)
+ (multiple-value-bind
+ (sec min hour day month year) (decode-universal-time ut)
+ (declare (ignore sec min hour))
+ (format nil "~a-~2,'0d-~2,'0d" year month day)))
+
(defmacro defplist (name &rest slots)
(let* ((slots-names
(loop for slot in slots
@@ -92,3 +98,4 @@ determined by EXECUTABLE-ON-SYSTEM-P."
`(progn
,make-name-defun
,@slot-defuns)))
+