Skip to content

Commit

Permalink
Deadline with NUM is displayed from NUM days before the date.
Browse files Browse the repository at this point in the history
  • Loading branch information
takashihattori committed Jun 30, 2017
1 parent 6341205 commit caf99e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion calfw-howm.el
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ from the howm schedule data."
for summary = (funcall cfw:howm-schedule-summary-transformer summary)
do
(cond
((< 0 num)
((and (string= type "@") (< 0 num))
(push (list date (cfw:date-after date (1- num)) summary) periods))
((and (string= type "!") (< 0 num))
(push (list (cfw:date-before date (1- num)) date summary) periods))
(t
(setq contents (cfw:contents-add date summary contents))))
finally return (nconc contents (list (cons 'periods periods)))))
Expand Down
5 changes: 5 additions & 0 deletions calfw.el
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,11 @@ ones of DATE2. Otherwise is `nil'."
(calendar-gregorian-from-absolute
(+ (calendar-absolute-from-gregorian date) num)))

(defun cfw:date-before (date num)
"Return the date before NUM days from DATE."
(calendar-gregorian-from-absolute
(- (calendar-absolute-from-gregorian date) num)))

(defun cfw:strtime-emacs (time)
"Format emacs time value TIME to the string form YYYY/MM/DD."
(format-time-string "%Y/%m/%d" time))
Expand Down

0 comments on commit caf99e3

Please sign in to comment.