emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Giovanni Ridolfi <giovanni.ridolfi@yahoo.it>
To: "Gustav Wikström" <gustav.erik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: "Last workday of month" scheduling
Date: Fri, 15 Oct 2010 15:39:19 +0200	[thread overview]
Message-ID: <83k4ljini0.fsf@yahoo.it> (raw)
In-Reply-To: <AANLkTimTo1n_2fiVxtNikL8-y1DzRmZacb6ftaO_RbYf@mail.gmail.com> ("Gustav Wikström"'s message of "Fri, 15 Oct 2010 09:00:25 +0200")

Gustav Wikström <gustav.erik@gmail.com> 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

      reply	other threads:[~2010-10-15 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15  7:00 "Last workday of month" scheduling Gustav Wikström
2010-10-15 13:39 ` Giovanni Ridolfi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k4ljini0.fsf@yahoo.it \
    --to=giovanni.ridolfi@yahoo.it \
    --cc=emacs-orgmode@gnu.org \
    --cc=gustav.erik@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).