Bug 173389 - calendar(1) displays wrong date for election day
Summary: calendar(1) displays wrong date for election day
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 8.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Oleksandr Tymoshenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-05 14:50 UTC by Steve Ames
Modified: 2020-04-10 22:19 UTC (History)
1 user (show)

See Also:
gonzo: mfc-stable12+
gonzo: mfc-stable11+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Ames 2012-11-05 14:50:00 UTC
	Running 'calendar -a 10' today produced this:
	Nov  5* Election Day in USA (1st Tuesday after 1st Monday for even years)

	November 5th is not a tuesday.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:45 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 2 commit-hook freebsd_committer freebsd_triage 2020-04-03 02:40:31 UTC
A commit references this bug:

Author: gonzo
Date: Fri Apr  3 02:39:46 UTC 2020
New revision: 359587
URL: https://svnweb.freebsd.org/changeset/base/359587

Log:
  Remove hardcoded US Election Day from calendar.usholiday

  calendar(1) syntax is not capable of representing the rules for the
  US Election Day. The hardcoded date was set in r15066 in 1996 and
  hasn't changed since then.

  PR:		173389
  Reported by:	Steve Ames <steve@energistic.com>
  MFC after:	1 week

Changes:
  head/usr.bin/calendar/calendars/calendar.usholiday
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-04-10 22:18:27 UTC
A commit references this bug:

Author: gonzo
Date: Fri Apr 10 22:18:14 UTC 2020
New revision: 359782
URL: https://svnweb.freebsd.org/changeset/base/359782

Log:
  MFC r359585, r359587

  r359585:
  Fix calculation of the recurring weekdays

  Both the result of the first_dayofweek_of_year and the target
  weekday are zero-based (0 fo sunday) while the target month-day
  or year-day is 1-based. Adjust logic accordingly.

  Also add testcase for this PR to the kyua test suite

  PR:		201062
  Submitted by:	Richard Narron <comet.berkeley@gmail.com>

  r359587:
  Remove hardcoded US Election Day from calendar.usholiday

  calendar(1) syntax is not capable of representing the rules for the
  US Election Day. The hardcoded date was set in r15066 in 1996 and
  hasn't changed since then.

  PR:		173389
  Reported by:	Steve Ames <steve@energistic.com>

Changes:
_U  stable/12/
  stable/12/usr.bin/calendar/calendars/calendar.usholiday
  stable/12/usr.bin/calendar/parsedata.c
  stable/12/usr.bin/calendar/tests/calendar.calibrate
  stable/12/usr.bin/calendar/tests/regress.s5.out
  stable/12/usr.bin/calendar/tests/regress.sh
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-04-10 22:19:31 UTC
A commit references this bug:

Author: gonzo
Date: Fri Apr 10 22:18:31 UTC 2020
New revision: 359783
URL: https://svnweb.freebsd.org/changeset/base/359783

Log:
  MFC r359585, r359587

  r359585:
  Fix calculation of the recurring weekdays

  Both the result of the first_dayofweek_of_year and the target
  weekday are zero-based (0 fo sunday) while the target month-day
  or year-day is 1-based. Adjust logic accordingly.

  Also add testcase for this PR to the kyua test suite

  PR:		201062
  Submitted by:	Richard Narron <comet.berkeley@gmail.com>

  r359587:
  Remove hardcoded US Election Day from calendar.usholiday

  calendar(1) syntax is not capable of representing the rules for the
  US Election Day. The hardcoded date was set in r15066 in 1996 and
  hasn't changed since then.

  PR:		173389
  Reported by:	Steve Ames <steve@energistic.com>

Changes:
_U  stable/11/
  stable/11/usr.bin/calendar/calendars/calendar.usholiday
  stable/11/usr.bin/calendar/parsedata.c
  stable/11/usr.bin/calendar/tests/calendar.calibrate
  stable/11/usr.bin/calendar/tests/regress.s5.out
  stable/11/usr.bin/calendar/tests/regress.sh