1
<?xml version="1.0" encoding="utf-8"?>
2
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="calendar" xml:lang="en_GB">
4
<link type="guide" xref="index#dialogs"/>
5
<desc>Use the <cmd>--calendar</cmd> option.</desc>
7
<title>Calendar Dialogue</title>
9
Use the <cmd>--calendar</cmd> option to create a calendar dialog. Zenity returns the selected date to standard output. If no date is specified on the command line, the dialog uses the current date.
11
<p>The calendar dialogue supports the following options:</p>
16
<title><cmd>--text</cmd>=<var>text</var></title>
17
<p>Specifies the text that is displayed in the calendar dialogue.</p>
21
<title><cmd>--day</cmd>=<var>day</var></title>
22
<p>Specifies the day that is selected in the calendar dialog. day must be a number between 1 and 31 inclusive.</p>
26
<title><cmd>--month</cmd>=<var>month</var></title>
27
<p>Specifies the month that is selected in the calendar dialog. month must be a number between 1 and 12 inclusive.</p>
31
<title><cmd>--year</cmd>=<var>year</var></title>
32
<p>Specifies the year that is selected in the calendar dialogue.</p>
36
<title><cmd>--date-format</cmd>=<var>format</var></title>
37
<p>Specifies the format that is returned from the calendar dialog after date selection. The default format depends on your locale. Format must be a format that is acceptable to the <cmd>strftime</cmd> function, for example <var>%A %d/%m/%y</var>.</p>
43
The following example script shows how to create a calendar dialog:
50
if zenity --calendar \
51
--title="Select a Date" \
52
--text="Click on a date to select that date." \
53
--day=10 --month=8 --year=2004
55
else echo "No date selected"
60
<figure id="zenity-calendar-screenshot">
61
<title>Calendar Dialogue Example</title>
62
<desc>Zenity calendar dialog example</desc>
63
<media type="image" mime="image/png" src="figures/zenity-calendar-screenshot.png"/>