如何在orgmode中设置月底的TODO截止日期?

时间:2016-01-22 20:11:52

标签: emacs org-mode

如何在本月的最后一个工作日为TODO设定截止日期?

1 个答案:

答案 0 :(得分:1)

我很确定这个功能可以做到。

(defun last-working-day-deadline ()
  (interactive)
  (let* ((date (calendar-current-date)) 
  (day (calendar-extract-day date))
  (month (calendar-extract-month date))
  (year (calendar-extract-year date))
  (lastday (calendar-last-day-of-month month year)))
  ;; workdays have "names" of 1 2 3 4 or 5
  (while (not (memq (calendar-day-of-week (list month lastday year)) '(1 2 3 4 5)))
  (decf lastday))
 (org-deadline nil (format "%s-%s-%s" year month lastday))))