[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calendar-nth-named-day wrong for first Sunday in April, 2001

From: Edward M. Reingold
Subject: Re: calendar-nth-named-day wrong for first Sunday in April, 2001
Date: 02 Apr 2001 21:41:43 -0500

>>>>> "HLT" == Hugh L Taylor <address@hidden> writes:

    HLT> (calendar-nth-named-day 1 0 4 2001 2) (4 8 2001) % should be (4 1
    HLT> 2001)

    HLT> (calendar-nth-named-day 1 1 4 2001 2) (4 2 2001) % OK;

The code is correct.  The doc string says:

    calendar-nth-named-day is a compiled Lisp function in `calendar'.
    (calendar-nth-named-day N DAYNAME MONTH YEAR &optional DAY)

    The date of Nth DAYNAME in MONTH, YEAR before/after optional DAY.
    A DAYNAME of 0 means Sunday, 1 means Monday, and so on.  If N<0,
    return the Nth DAYNAME before MONTH DAY, YEAR (inclusive).
    If N>0, return the Nth DAYNAME after MONTH DAY, YEAR (inclusive).

    If DAY is omitted, it defaults to 1 if N>0, and MONTH's last day otherwise.

Since your first example has a "2" as the optional parameter, you are
asking for the first Sunday on or after April 2.

Professor Edward M. Reingold                Email: address@hidden
Chairman, Department of Computer Science    Voice: (312) 567-3309
Illinois Institute of Technology            Fax:   (312) 567-5067
Stuart Building
10 West 31st Street, Suite 236
Chicago, IL  60616-3729  U.S.A.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]