[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] Re: planner-diary ( Last Day of Month )
From: |
Sacha Chua |
Subject: |
[emacs-wiki-discuss] Re: planner-diary ( Last Day of Month ) |
Date: |
Tue, 28 Jun 2005 11:06:44 +0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
"Paul D. Kraus" <address@hidden> writes:
> How can I set an appointment that is always going to be on the last day
> of the month?
After some poking around, I came up with
(defun diary-last-day (month year &optional mark)
"Return the last day of the month.
Entry applies if date is the last day in MONTH, YEAR. The
constant t means all values.
An optional parameter MARK specifies a face or single-character
string to use when highlighting the day in the calendar."
(let ((m (extract-calendar-month date))
(y (extract-calendar-year date))
(d (extract-calendar-day date)))
(when (and
(or (eq month t)
(= m month))
(or (eq year t)
(= y year))
(= d (calendar-last-day-of-month m y)))
(cons mark entry))))
Include %%(diary-last-day t t) Your Entry Here in your diary file. =)
There's probably a better way to do it out there..
--
Sacha Chua <address@hidden> - open source geekette
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C
interests: emacs, gnu/linux, personal information management, CS ed
sachac on irc.freenode.net#emacs . YM: sachachua83