[time] calendar() uses argn(1)==0 instead of 'display'
[scilab.git] / scilab / modules / time / help / en_US / calendar.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) INRIA -
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  * Copyright (C) 2019 - Samuel GOUGEON
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
18           xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
19           xml:lang="en" xml:id="calendar">
20     <refnamediv>
21         <refname>calendar</refname>
22         <refpurpose>Calendar of a given month and year (Gregorian dates)</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>Syntax</title>
26         <synopsis>
27             calendar
28             calendar(y, m)
29             c = calendar()
30             c = calendar(y,m)
31         </synopsis>
32     </refsynopsisdiv>
33     <refsection>
34         <title>Arguments</title>
35         <variablelist>
36             <varlistentry>
37                 <term>y</term>
38                 <listitem>
39                     <para>integer in [1800 3000]: The Gregorian year.</para>
40                 </listitem>
41             </varlistentry>
42             <varlistentry>
43                 <term>m</term>
44                 <listitem>
45                     <para>integer in [1, 12]: The month.</para>
46                 </listitem>
47             </varlistentry>
48             <varlistentry>
49                 <term>c</term>
50                 <listitem>
51                     <para>list, with
52                         <table>
53                             <tr><th>c(1):</th><td>single string: The calendar title</td></tr>
54                             <tr><th>c(2):</th><td>single string: Days names.</td></tr>
55                             <tr><th>c(3):</th><td>6x7 matrix of days indices in the month
56                                                     (0 for days out of the month)</td>
57                             </tr>
58                         </table>
59                     </para>
60                     <para>
61                         The title and days names are translated according to the current language.
62                     </para>
63                 </listitem>
64             </varlistentry>
65         </variablelist>
66     </refsection>
67     <refsection>
68         <title>Description</title>
69         <para>
70             <emphasis role="bold">calendar</emphasis> displays in the console the
71             calendar of the current month.
72         </para>
73         <para>
74             <emphasis role="bold">calendar(y, m)</emphasis> displays in the console the
75             calendar of the month <varname>m</varname> for the year <varname>y</varname>.
76         </para>
77         <para>
78             <emphasis role="bold">c = calendar()</emphasis> returns a list containing the
79                 calendar for the current month. Weeks start on Monday and end on Sunday.
80         </para>
81         <para>
82             <emphasis role="bold">c = calendar(y, m)</emphasis> returns a list containing the
83                 calendar for the given month and year.
84         </para>
85     </refsection>
86     <refsection>
87         <title>Examples</title>
88         <programlisting role="example"><![CDATA[
89 c = calendar()
90  ]]></programlisting>
91       <screen><![CDATA[
92 --> c = calendar()
93  c  =
94        c(1)
95  Dec 2019
96
97        c(2)
98  Mon  Tue  Wed  Thu  Fri  Sat  Sun
99
100        c(3)
101    0.    0.    0.    0.    0.    0.    1.
102    2.    3.    4.    5.    6.    7.    8.
103    9.    10.   11.   12.   13.   14.   15.
104    16.   17.   18.   19.   20.   21.   22.
105    23.   24.   25.   26.   27.   28.   29.
106    30.   31.   0.    0.    0.    0.    0.
107 ]]></screen>
108         <para/>
109         <programlisting role="example"><![CDATA[
110 calendar
111  ]]></programlisting>
112       <screen><![CDATA[
113 --> calendar
114
115              Dec 2019
116  Mon  Tue  Wed  Thu  Fri  Sat  Sun
117                                 1
118   2    3    4    5    6    7    8
119   9   10   11   12   13   14   15
120  16   17   18   19   20   21   22
121  23   24   25   26   27   28   29
122  30   31                         
123 ]]></screen>
124         <para/>
125         <programlisting role="example"><![CDATA[
126 calendar(1973, 8)
127  ]]></programlisting>
128       <screen><![CDATA[
129 --> calendar(1973, 8)
130  
131              Aug 1973
132  Mon  Tue  Wed  Thu  Fri  Sat  Sun
133             1    2    3    4    5
134   6    7    8    9   10   11   12
135  13   14   15   16   17   18   19
136  20   21   22   23   24   25   26
137  27   28   29   30   31          
138 ]]></screen>
139     </refsection>
140     <refsection role="see also">
141         <title>See also</title>
142         <simplelist type="inline">
143             <member>
144                 <link linkend="weekday">weekday</link>
145             </member>
146             <member>
147                 <link linkend="datevec">datevec</link>
148             </member>
149             <member>
150                 <link linkend="datenum">datenum</link>
151             </member>
152         </simplelist>
153     </refsection>
154     <refsection role="history">
155         <title>History</title>
156         <revhistory>
157             <revision>
158                 <revnumber>6.1</revnumber>
159                 <revdescription>
160                     Formated display in the console added.
161                 </revdescription>
162             </revision>
163         </revhistory>
164     </refsection>
165 </refentry>