/usr/share/calendar/calendar.christian - two entries for "First Sunday of Advent (4th Sunday before Christmas)"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

/usr/share/calendar/calendar.christian - two entries for "First Sunday of Advent (4th Sunday before Christmas)"

Raf Czlonka-2
Hi all,

I've just noticed something strange in the
/usr/share/calendar/calendar.christian file, namely:

        11/SunLast First Sunday of Advent (4th Sunday before Christmas)
        12/SunFirst First Sunday of Advent (4th Sunday before Christmas)

Obviously, in any given year either is true - not both.

I do understand the intent - the beginning of Advent will either
be on the last Sunday of November or the first Sunday of December
depending which day of the week Christmas Day falls on.

Calculating it isn't difficult - last Thursday of November + 3 days -
but I'm not sure whether adding any additional code to calendar(1)
is desirable.

I don't know what the best solution to the above is as currently,
as it stands, these entries are confusing - at first glance the
above looks like a bug and after figuring out it isn't one, I'm
sill none the wise which one it is without consulting another
calendar.

Adding code, modifying the above entries or an additional entry in
the BUGS section in the manual. What are your thought?

Best regards,

Raf

Reply | Threaded
Open this post in threaded view
|

Re: /usr/share/calendar/calendar.christian - two entries for "First Sunday of Advent (4th Sunday before Christmas)"

Raf Czlonka-2
It's that magical time of the year again :^)

Anyone?

R.

On Sun, Nov 12, 2017 at 08:11:04AM GMT, Raf Czlonka wrote:

> Hi all,
>
> I've just noticed something strange in the
> /usr/share/calendar/calendar.christian file, namely:
>
> 11/SunLast First Sunday of Advent (4th Sunday before Christmas)
> 12/SunFirst First Sunday of Advent (4th Sunday before Christmas)
>
> Obviously, in any given year either is true - not both.
>
> I do understand the intent - the beginning of Advent will either
> be on the last Sunday of November or the first Sunday of December
> depending which day of the week Christmas Day falls on.
>
> Calculating it isn't difficult - last Thursday of November + 3 days -
> but I'm not sure whether adding any additional code to calendar(1)
> is desirable.
>
> I don't know what the best solution to the above is as currently,
> as it stands, these entries are confusing - at first glance the
> above looks like a bug and after figuring out it isn't one, I'm
> sill none the wise which one it is without consulting another
> calendar.
>
> Adding code, modifying the above entries or an additional entry in
> the BUGS section in the manual. What are your thought?
>
> Best regards,
>
> Raf

Reply | Threaded
Open this post in threaded view
|

Re: /usr/share/calendar/calendar.christian - two entries for "First Sunday of Advent (4th Sunday before Christmas)"

Jason McIntyre-2
On Sun, Nov 11, 2018 at 11:03:35PM +0000, Raf Czlonka wrote:
> It's that magical time of the year again :^)
>
> Anyone?
>
> R.
>

morning.

i suspect either the intent was to cover all cases, or one was added
without the other being removed by mistake. unfortunately calendar
doesn;t handle such dates well.

firstly, the BUGS entry: maybe we should just say that calendar doesn;t
handle all holidays, rather than singling out jewish ones.

the solution to your question - someone writes code to handle this, or
someone steps up to maintain the file. it won;t be me, i'm afraid.

jmc

> On Sun, Nov 12, 2017 at 08:11:04AM GMT, Raf Czlonka wrote:
> > Hi all,
> >
> > I've just noticed something strange in the
> > /usr/share/calendar/calendar.christian file, namely:
> >
> > 11/SunLast First Sunday of Advent (4th Sunday before Christmas)
> > 12/SunFirst First Sunday of Advent (4th Sunday before Christmas)
> >
> > Obviously, in any given year either is true - not both.
> >
> > I do understand the intent - the beginning of Advent will either
> > be on the last Sunday of November or the first Sunday of December
> > depending which day of the week Christmas Day falls on.
> >
> > Calculating it isn't difficult - last Thursday of November + 3 days -
> > but I'm not sure whether adding any additional code to calendar(1)
> > is desirable.
> >
> > I don't know what the best solution to the above is as currently,
> > as it stands, these entries are confusing - at first glance the
> > above looks like a bug and after figuring out it isn't one, I'm
> > sill none the wise which one it is without consulting another
> > calendar.
> >
> > Adding code, modifying the above entries or an additional entry in
> > the BUGS section in the manual. What are your thought?
> >
> > Best regards,
> >
> > Raf
>

Reply | Threaded
Open this post in threaded view
|

Re: /usr/share/calendar/calendar.christian - two entries for "First Sunday of Advent (4th Sunday before Christmas)"

Scott Cheloha
On Mon, Nov 12, 2018 at 07:00:31AM +0000, Jason McIntyre wrote:

> On Sun, Nov 11, 2018 at 11:03:35PM +0000, Raf Czlonka wrote:
> > It's that magical time of the year again :^)
> >
> > Anyone?
> >
> > R.
> >
>
> morning.
>
> [...] unfortunately calendar doesn;t handle such dates well.

This fact is documented for calendar.christian.  calendar.1 says:

>     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 dates are included there to demonstrate the variability and the
intent is that your admin update the file periodically (how quaint!).

> firstly, the BUGS entry: maybe we should just say that calendar doesn;t
> handle all holidays, rather than singling out jewish ones.

Something like "calendar doesn't handle roving holidays..." and perhaps
provide an example or two could work.  It think it's written that way
because there are a number of Jewish holidays that "move around", so to
speak.

> the solution to your question - someone writes code to handle this, or
> someone steps up to maintain the file. it won;t be me, i'm afraid.

I think the priority of certain keywords could be adjusted to make
calendar produce results more in line with what a user might expect.

Unclear if such a change is even allowed given the software's well
established behavior, but currently the entry

11/ThuLast+3\tFirst Sunday of Advent

yields November 15th.  This happens because the parser prioritizes "Thu"
and +3 over "ThuLast".  Stepping through it in the debugger, "Last" is never
even looked at.  So you get the 3rd thursday in November, i.e. Nov 15th.

But intuitively you ought to get 3 days after the last Thursday in November,
i.e. (this year) December 2nd.

I'm going to give making this change a shot just for the hell of it.  And if
it's too late to change the behavior, *shrugs*.

> > On Sun, Nov 12, 2017 at 08:11:04AM GMT, Raf Czlonka wrote:
> > > Hi all,
> > >
> > > I've just noticed something strange in the
> > > /usr/share/calendar/calendar.christian file, namely:
> > >
> > > 11/SunLast First Sunday of Advent (4th Sunday before Christmas)
> > > 12/SunFirst First Sunday of Advent (4th Sunday before Christmas)
> > >
> > > Obviously, in any given year either is true - not both.
> > >
> > > I do understand the intent - the beginning of Advent will either
> > > be on the last Sunday of November or the first Sunday of December
> > > depending which day of the week Christmas Day falls on.
> > >
> > > Calculating it isn't difficult - last Thursday of November + 3 days -
> > > but I'm not sure whether adding any additional code to calendar(1)
> > > is desirable.
> > >
> > > I don't know what the best solution to the above is as currently,
> > > as it stands, these entries are confusing - at first glance the
> > > above looks like a bug and after figuring out it isn't one, I'm
> > > sill none the wise which one it is without consulting another
> > > calendar.
> > >
> > > Adding code, modifying the above entries or an additional entry in
> > > the BUGS section in the manual. What are your thought?
> > >
> > > Best regards,
> > >
> > > Raf
> >
>