1
<?xml version="1.0" encoding="utf-8"?>
2
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="calendar" xml:lang="sl">
4
<link type="guide" xref="index#dialogs"/>
5
<desc>Use the <cmd>--calendar</cmd> option.</desc>
7
<title>Calendar Dialog</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.
12
The calendar dialog supports the following options:
18
<title><cmd>--text</cmd>=<var>text</var></title>
19
<p>Specifies the text that is displayed in the calendar dialog.</p>
23
<title><cmd>--day</cmd>=<var>day</var></title>
24
<p>Specifies the day that is selected in the calendar dialog. day must be a number between 1 and 31 inclusive.</p>
28
<title><cmd>--month</cmd>=<var>month</var></title>
29
<p>Specifies the month that is selected in the calendar dialog. month must be a number between 1 and 12 inclusive.</p>
33
<title><cmd>--year</cmd>=<var>year</var></title>
34
<p>Specifies the year that is selected in the calendar dialog.</p>
38
<title><cmd>--date-format</cmd>=<var>format</var></title>
39
<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>
45
The following example script shows how to create a calendar dialog:
52
if zenity --calendar \
53
--title="Select a Date" \
54
--text="Click on a date to select that date." \
55
--day=10 --month=8 --year=2004
57
else echo "No date selected"
62
<figure id="zenity-calendar-screenshot">
63
<title>Calendar Dialog Example</title>
64
<desc>Zenity calendar dialog example</desc>
65
<media type="image" mime="image/png" src="figures/zenity-calendar-screenshot.png"/>