org-habit: Use org-today.

* org-habit.el: Use org-today.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2010-11-29 19:18:32 +00:00 committed by Carsten Dominik
parent d1eb6cb25b
commit 1dcb374f48
1 changed files with 3 additions and 7 deletions

View File

@ -197,10 +197,7 @@ This list represents a \"habit\" for the rest of this module."
"Determine the relative priority of a habit. "Determine the relative priority of a habit.
This must take into account not just urgency, but consistency as well." This must take into account not just urgency, but consistency as well."
(let ((pri 1000) (let ((pri 1000)
(now (time-to-days (now (if moment (time-to-days moment) (org-today)))
(or moment
(time-subtract (current-time)
(list 0 (* 3600 org-extend-today-until) 0)))))
(scheduled (org-habit-scheduled habit)) (scheduled (org-habit-scheduled habit))
(deadline (org-habit-deadline habit))) (deadline (org-habit-deadline habit)))
;; add 10 for every day past the scheduled date, and subtract for every ;; add 10 for every day past the scheduled date, and subtract for every
@ -240,7 +237,7 @@ Habits are assigned colors on the following basis:
(deadline (if scheduled-days (deadline (if scheduled-days
(+ scheduled-days (- d-repeat s-repeat)) (+ scheduled-days (- d-repeat s-repeat))
(org-habit-deadline habit))) (org-habit-deadline habit)))
(m-days (or now-days (time-to-days (current-time))))) (m-days (or now-days (org-today))))
(cond (cond
((< m-days scheduled) ((< m-days scheduled)
'(org-habit-clear-face . org-habit-clear-future-face)) '(org-habit-clear-face . org-habit-clear-future-face))
@ -319,8 +316,7 @@ current time."
"Insert consistency graph for any habitual tasks." "Insert consistency graph for any habitual tasks."
(let ((inhibit-read-only t) l c (let ((inhibit-read-only t) l c
(buffer-invisibility-spec '(org-link)) (buffer-invisibility-spec '(org-link))
(moment (time-subtract (current-time) (moment (days-to-time (org-today))))
(list 0 (* 3600 org-extend-today-until) 0))))
(save-excursion (save-excursion
(goto-char (if line (point-at-bol) (point-min))) (goto-char (if line (point-at-bol) (point-min)))
(while (not (eobp)) (while (not (eobp))