Ihor Radchenko <yanta...@posteo.net> writes:
You don't need diary-float - it returns true/false whether
current DATE
fits the arguments.
Instead, you can make use of `calendar-nth-named-absday'.
For example,
<%%(and (= 245 (mf-days-from-easter))
(< (calendar-absolute-from-gregorian date)
(calendar-nth-named-absday -4 0 12 24)))>
Diary sexps are nothing but ordinary Elisp, with an extra twist
that
during evaluation `date' variable is bound to current calendar
date.
When they return nil, DATE does not match.
Thank you!
It seems that `calendar-nth-named-absday' wants the year after the
month, and then an (optional) day of the month to count from.
Since I hoped to keep re-using this material every year without
re-entering the calculations, I've tried the following:
In my init file, I've added these two short definitions:
(defun mf-beginning-of-advent (displayed-year)
(calendar-nth-named-absday -4 0 12 displayed-year 24))
(defun mf-days-from-advent ()
(- (calendar-absolute-from-gregorian date)
(mf-beginning-of-advent (calendar-extract-year date))))
And my Org file has this:
* Example 1
<%%(and (= 245 (mf-days-from-easter)) (<= (mf-days-from-advent)
-1))>
This setup seems to work so far. Does it look reasonable to you?
--
David