Handle if task does bot have due date set in eldoc message
This commit is contained in:
parent
032f4036ad
commit
f1fad58220
1 changed files with 13 additions and 8 deletions
|
@ -41,7 +41,8 @@
|
||||||
(let* ((id (taskwarrior-id-at-point))
|
(let* ((id (taskwarrior-id-at-point))
|
||||||
(task (taskwarrior-export-task id))
|
(task (taskwarrior-export-task id))
|
||||||
(due (taskwarrior--parse-timestamp (alist-get 'due task))))
|
(due (taskwarrior--parse-timestamp (alist-get 'due task))))
|
||||||
(message "Due: %s" due)))
|
(when due
|
||||||
|
(message "Due: %s" due))))
|
||||||
|
|
||||||
(defun taskwarrior-previous-task ()
|
(defun taskwarrior-previous-task ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -207,13 +208,17 @@ the front and focus it. Otherwise, create one and load the data."
|
||||||
|
|
||||||
(defun taskwarrior--parse-timestamp (ts)
|
(defun taskwarrior--parse-timestamp (ts)
|
||||||
"Turn the taskwarrior timestamp into a readable format"
|
"Turn the taskwarrior timestamp into a readable format"
|
||||||
|
(if (not ts)
|
||||||
|
ts
|
||||||
(let ((year (substring ts 0 4))
|
(let ((year (substring ts 0 4))
|
||||||
(month (substring ts 4 6))
|
(month (substring ts 4 6))
|
||||||
(day (substring ts 6 8))
|
(day (substring ts 6 8))
|
||||||
(hour (substring ts 9 11))
|
(hour (substring ts 9 11))
|
||||||
(minute (substring ts 11 13))
|
(minute (substring ts 11 13))
|
||||||
(second (substring ts 13 15)))
|
(second (substring ts 13 15)))
|
||||||
(format "%s-%s-%s %s:%s:%s" year month day hour minute second)))
|
(format "%s-%s-%s %s:%s:%s" year month day hour minute second))))
|
||||||
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x t") 'taskwarrior)
|
(global-set-key (kbd "C-x t") 'taskwarrior)
|
||||||
|
(taskwarrior--set-filter "project:pro5")
|
||||||
|
(message (car taskwarrior-active-filters))
|
||||||
|
|
Loading…
Reference in a new issue