[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] "Last workday of month" scheduling
From: |
Giovanni Ridolfi |
Subject: |
Re: [Orgmode] "Last workday of month" scheduling |
Date: |
Fri, 15 Oct 2010 15:39:19 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt) |
Gustav Wikström <address@hidden> writes:
Hi Gustav,
> Is there a way in Org-mode to schedule a task so it appears the last
> workday (i.e. not Saturday or Sunday) of the month, each month?
Yes, with a sexp diary entry
** a task
SCHEDULED: <%%(diary-float [some-function])>
To find how [some-function] could be written,
you can be inspired by the one in Emacs manual:
38.15.9 Sexp Entries and the Fancy Diary Display
Suppose you get paid on the 21st of the month if it is a weekday, and
on the Friday before if the 21st is on a weekend. Here is how to write
a sexp diary entry that matches those dates:
&%%(let ((dayname (calendar-day-of-week date))
(day (cadr date)))
(or (and (= day 21) (memq dayname '(1 2 3 4 5)))
(and (memq day '(19 20)) (= dayname 5)))
) Pay check deposited
Giovanni