Add deadline to default output

This commit is contained in:
Nikolay Puzanov 2014-05-22 11:49:39 +04:00
parent 8ae233c57c
commit dc7ebb4286

View File

@ -689,10 +689,26 @@
;; Show running task ;; Show running task
(let ((last (last-task sheet))) (let ((last (last-task sheet)))
(if (and last (not (caddr last))) (if (and last (not (caddr last)))
(format #t "~a: ~a\n" (let* ((path (car last))
(path->string (car last)) (timer (date-difference (current-date) (cadr last))))
(time->string (format #t "~a: ~a ~a\n"
(date-difference (current-date) (cadr last)))) (path->string path)
(time->string timer)
;; Print deadline
(let ((deadline (find-by-path deadlines path)))
(if (and deadline (cadr deadline))
(let ((deadtime (cadr deadline)))
(string-append
"(" (if (or (and (date? deadtime)
(date<? (date-round-day deadtime)
(date-round-day (current-date))))
(and (time? deadtime)
(time<? deadtime timer)))
"expired"
(date/time->string deadtime))
")"))
""))))
(format #t "NO TASKS\n"))) (format #t "NO TASKS\n")))
;; Else run command ;; Else run command