[Remind-Fans] Mother's day in France
Alain Guibert
alguibert+rf at free.fr
Wed Jun 20 16:21:09 EDT 2007
On Tuesday, June 19, 2007 at 12:11:23 +0200, @@ wrote:
> But after Mother's day, it's executed for current year and the result
> is "Today"!
Gerhard's solution works very well for me. Thanks again, man! Confirmed
it matches paper calendar reality over 10 years:
| $ rem -s120 May 1999 | grep "Fête des Mères"
| 1999-05-30 * * * * Fête des Mères
| 2000-05-28 * * * * Fête des Mères
| 2001-05-27 * * * * Fête des Mères
| 2002-05-26 * * * * Fête des Mères
| 2003-05-25 * * * * Fête des Mères
| 2004-06-06 * * * * Fête des Mères
| 2005-05-29 * * * * Fête des Mères
| 2006-05-28 * * * * Fête des Mères
| 2007-06-03 * * * * Fête des Mères
| 2008-05-25 * * * * Fête des Mères
However the posted solution had 2 small glitches I corrected:
- "Mère" wants its plural "s".
- "Sun 1 Jun -7" is not last Sunday of May, but exactly 7 unomitted
days before first Sunday of June. Problem: In 2003, OMITted Ascension
Thursday falls on 29 May 2003, in the middle of this week. The -7 skips
this day, total 8 days backwards, and so places Mother's day wrongly on
Saturday 24 May 2003, instead of Sunday 25. Solution: I had to use "--7"
instead (ignores OMITed days). Yet better, I used the Sun [_last(May)]
function: That's clearly more readable, and avoids such -/-- mistakes.
In summary I now use:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Solution de Gerhard Kirchmann sur Remind-Fans
# pour: Fête des Mères le dernier dimanche de mai, sauf si
# c'est la Pentecôte, alors le premier dimanche de juin.
SET _pentecote easterdate(year(today()))+49
IFTRIG Sun [_last(May)]
IFTRIG [trigger(_pentecote)]
ELSE
MSG Fête des Mères
ENDIF
ENDIF
IFTRIG Sun [Week_1] Jun
IF [(_pentecote+7)==today()]
MSG Fête des Mères
ENDIF
ENDIF
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Alain.
More information about the Remind-fans
mailing list