blob: 1f3931e40e6836614b44e2f9e008792a365b2a61 [file] [log] [blame]
Fred Drake1c127e71998-04-28 14:28:57 +00001% This section was contributed by Drew Csillag <drew_csillag@geocities.com>.
2
3\section{Standard Module \module{calendar}}
4\label{module-calendar}
5\stmodindex{calendar}
6
7
8This module allows you to output calendars like the \UNIX{}
9\manpage{cal}{1} program.
10
11\begin{funcdesc}{isleap}{year}
12Returns \code{1} if \var{year} is a leap year.
13\end{funcdesc}
14
15\begin{funcdesc}{leapdays}{year1, year2}
16Return the number of leap years in the range
17[\var{year1}\ldots\var{year2}].
18\end{funcdesc}
19
20\begin{funcdesc}{weekday}{year, month, day}
21Returns the day of the week (\code{0} is Monday) for \var{year}
22(\code{1970}--\dots), \var{month} (\code{1}--\code{12}), \var{day}
23(\code{1}--\code{31}).
24\end{funcdesc}
25
26\begin{funcdesc}{monthrange}{year, month}
27Returns weekday of first day of the month and number of days in month,
28for the specified \var{year} and \var{month}.
29\end{funcdesc}
30
31\begin{funcdesc}{monthcalendar}{year, month}
32Returns a matrix representing a month's calendar. Each row represents
33a week; days outside of the month a represented by zeros.
34\end{funcdesc}
35
36\begin{funcdesc}{prmonth}{year, month\optional{, width\optional{, length}}}
37Prints a month's calendar. If \var{width} is provided, it specifies
38the width of the columns that the numbers are centered in. If
39\var{length} is given, it specifies the number of lines that each
40week will use.
41\end{funcdesc}
42
43\begin{funcdesc}{prcal}{year}
44Prints the calendar for the year \var{year}.
45\end{funcdesc}