From Dan_Grillo@grillo.net  Fri Mar 29 11:10:08 2002
Return-Path: <Dan_Grillo@grillo.net>
Received: from grillo.net (adsl-216-103-84-67.dsl.snfc21.pacbell.net [216.103.84.67])
	by hub.freebsd.org (Postfix) with ESMTP id 0FB9537B417
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Mar 2002 11:10:03 -0800 (PST)
Received: from gti.grillo.net (gti [192.168.2.154])
	by grillo.net (8.9.3/8.9.3) with ESMTP id LAA50511
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 29 Mar 2002 11:10:02 -0800 (PST)
	(envelope-from grio@gti.grillo.net)
Received: (from grio@localhost)
	by gti.grillo.net (8.11.6/8.11.1) id g2TJA9Z13867;
	Fri, 29 Mar 2002 11:10:09 -0800 (PST)
	(envelope-from grio)
Message-Id: <200203291910.g2TJA9Z13867@gti.grillo.net>
Date: Fri, 29 Mar 2002 11:10:09 -0800 (PST)
From: Dan Grillo <Dan_Grillo@grillo.net>
Reply-To: Dan Grillo <Dan_Grillo@grillo.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: /usr/bin/calendar can't handle recurring items in the next month
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         36501
>Category:       bin
>Synopsis:       calendar(1) can't handle recurring items in the next month
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    edwin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 29 11:20:00 PST 2002
>Closed-Date:    Mon Mar 01 00:56:18 UTC 2010
>Last-Modified:  Mon Mar 01 00:56:18 UTC 2010
>Originator:     Dan Grillo
>Release:        FreeBSD 4.4-RELEASE i386
>Organization:
>Environment:
System: FreeBSD gti.grillo.net 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Sun Oct 28 20:35:43 PST 2001 grio@gti.grillo.net:/usr/src/sys/compile/GTI i386

Also occurs on 4.5-RELEASE

	
>Description:

calendar allows for recurring meetings (like "every Monday") to be entered in 
calendar file in the form:

Monday	Text

Calendar is unable to compute the correct dates if the recurring item
falls beyond the current month.


>How-To-Repeat:
	

Here's an example:

	~/.calendar gti.grillo.net[28]> date
	Fri Mar 29 10:49:20 PST 2002

	~/.calendar gti.grillo.net[29]> cat calendar
	Monday  This Is every Monday

	Apr 1   This is an April 1 meeting

	~/.calendar gti.grillo.net[30]> /usr/bin/calendar -A 10
	Mar 32* This Is every Monday
	Apr  1* This is an April 1 meeting

Notice the bogus date of Mar 32, which instead should be Apr 1 also.
Once we get to April the Monday meeting with correctly show as Apr 1.


>Fix:
>Release-Note:
>Audit-Trail:

From: "Michael A. Dickerson" <mikey@redlance.singingtree.com>
To: freebsd-gnats-submit@freebsd.org, <Dan_Grillo@grillo.net>
Cc:  
Subject: Re: bin/36501: /usr/bin/calendar can't handle recurring items in
 the next month
Date: Tue, 2 Apr 2002 20:47:14 -0800 (PST)

 Several people have noticed that calendar(1) is brain damaged in a number
 of ways.  Not only does it generate nonsense dates like Mar 32, it seems
 it can't really process recurring events (first Sunday every month, etc)
 at all.  See bin/34497 from Jan 31 and also bin/4629 from September 1997
 (!).
 
 I have ported the calendar from OpenBSD, which was rewritten a couple
 years ago such that it works.  The patch is about 60k.  However, before
 you go to the trouble, you might try updating your source and rebuilding.
 I see somebody made some changes to usr.sbin/calendar on March 12 which
 might fix your problem.  If not I can send you my patch if you like.
 
 M.D
 
 
 
Responsible-Changed-From-To: freebsd-bugs->grog 
Responsible-Changed-By: kris 
Responsible-Changed-When: Thu Nov 6 19:06:13 PST 2003 
Responsible-Changed-Why:  
Assign to calendar maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36501 

From: Andriy Gapon <avg@icyb.net.ua>
To: bug-followup@FreeBSD.org, Dan_Grillo@grillo.net
Cc:  
Subject: Re: bin/36501: /usr/bin/calendar can't handle recurring items in
 the next month
Date: Thu, 01 Dec 2005 13:48:52 +0200

 Guys,
 
 I think importing OpenBSD calendar is a great idea and it is long
 overdue. FreeBSD calendar(1) is still very deficient with respect to
 dates bound to weekdays.
 
 Just a few examples:
 1) calendar may internally treat first <weekday> of the next month as
 fifth <weekday> of this month and thus fail to match it
 2) calendar may "invent" extra days in month if <weekday> falls onto
 next month
 3) calendar is not capable to print all matching entries if -A is used
 and date range covers more than one matching weekday.
 
 You can reproduce the above problems this way:
 
 $ cat > /tmp/calendar.test <<CALENDAR
 Thu	test entry for every Thursday
 Thu+1	test entry for first Thursday
 CALENDAR
 
 $ calendar -f /tmp/calendar.test -t 30.11.2005
 31 Nov* test entry for every Thursday
 
 $ calendar -f /tmp/calendar.test -A 15 -t 20.11.2005
 24 Nov* test entry for every Thursday
 
 $ calendar -f /tmp/calendar.test -t 01.12.2005
  1 Dec* test entry for every Thursday
  1 Dec* test entry for first Thursday
 
 
 I've copied OpenBSD sources for calendar and was able to compile it and
 get it to run with a few simple changes (related to tzfile.h, dependancy
 on libutil and date format for -t option). See how much better OpenBSD
 calendar does:
 
 $ obsd_calendar -f /tmp/calendar.test -t 30.11.2005
 Dec 01* test entry for every Thursday
 Dec 01* test entry for first Thursday
 
 $ obsd_calendar -f /tmp/calendar.test -A 15 -t 20.11.2005
 Nov 24* test entry for every Thursday
 Dec 01* test entry for every Thursday
 Dec 01* test entry for first Thursday
 
 -- 
 Andriy Gapon
Responsible-Changed-From-To: grog->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jun 25 02:12:49 UTC 2007 
Responsible-Changed-Why:  
grog@ asked me take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=4629 
Responsible-Changed-From-To: grog->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jun 25 02:12:49 UTC 2007 
Responsible-Changed-Why:  
grog@ asked me to take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=26658 
Responsible-Changed-From-To: grog->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jun 25 02:12:49 UTC 2007 
Responsible-Changed-Why:  
grog@ asked me to take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=34497 
Responsible-Changed-From-To: grog->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Jun 25 02:12:49 UTC 2007 
Responsible-Changed-Why:  
grog@ asked me to take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36501 
Responsible-Changed-From-To: edwin->freebsd-bugs 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Feb 14 10:27:36 UTC 2008 
Responsible-Changed-Why:  
Give back into pool until later. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36501 
State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Mon Mar 1 00:55:31 UTC 2010 
State-Changed-Why:  
Cannot reproduce this on a recent calendar. 
Issue is most likely resolved in the upcoming calendar import. 


Responsible-Changed-From-To: freebsd-bugs->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Mar 1 00:55:31 UTC 2010 
Responsible-Changed-Why:  
I'll track it if needed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36501 
>Unformatted:
