On Sun, 4 Dec 2022, Jason McIntyre wrote:

> On Sun, Dec 04, 2022 at 08:02:36AM -0800, Richard Narron wrote:
> > Advent is the Sunday that is 4 weeks before the Sunday before Christmas.
> >
> > In OpenBSD 7.2, I configured the .calendar/calendar to
> >
> > #include #include <calendar.christian>
> >
> > And this month (December 2022) the calendar message wrongly shows
> > Advent on December 4:
> >
> >   Dec 04* First Sunday of Advent (4th Sunday before Christmas)
> >
> > Advent was actually on November 27, 2022...
> >
> > The bug is because of these lines in calendar.christian:
> >
> >   11/SunLast      First Sunday of Advent (4th Sunday before Christmas)
> >   12/SunFirst     First Sunday of Advent (4th Sunday before Christmas)
> >
> > Sometimes Advent starts on the third Sunday of November, not always
> > the last Sunday of November.
> >
> > The "First Sunday of Advent" never occurs in December and only occurs
> > in November.
> >
> > So these lines need to be changed...
> >
> > My idea is to replace these two lines using a new "special event"
> > called "Advent":
> >
> >   Advent  First Sunday of Advent (4th Sunday before Christmas)
> >   Advent+7        Second Sunday of Advent (3rd Sunday before Christmas)
> >   Advent+14       Third Sunday of Advent (2nd Sunday before Christmas)
> >   Advent+21       Fourth Sunday of Advent (Sunday before Christmas)
> >
> > Here are 5 patches to the 7.2 /usr/src/usr.bin/calendar files:
> >
> i can;t comment on your code or whether such a soution is preferred,
> but i can point you to calendar(1) itself:
>
>        calendar.christian    Christian holidays (should be updated
>                              yearly by the local system
>                              administrator so that roving holidays
>                              are set correctly for the current
>                              year).
>
> so the idea is the system admin sets it. though maybe there are better
> solutions now...
>
> anyway it looks like somehow we have an extra entry for advent, and we
> should just have one. i won;t attempt an edit at the minute in case
> there is any follow up.

Thanks for looking at this.  There should probably be only one entry for
Advent.

It looks like I have the wrong algorithm for Advent in the advent.c
code...

The first day Advent is not always in November, apparently it is the
Sunday nearest St Andrews Day which is November 30...

So Advent can be from November 27 to December 3.

Wikipedia mentions that It falls on the last Thursday in November plus 3
days which is also the first Thursday in December minus 4 days.

It is too bad we cannot just use an entry like this:

11/ThuLast+3    First Sunday of Advent (4th Sunday before Christmas)

I will figure out a better formula for Advent and resubmit the
advent.c code.

Reply via email to