uicalendar

Graphical calendar

Syntax

uicalendar('PARAM1', VALUE1, 'PARAM2', VALUE2', ...)

Arguments

'BusDays'

Values are:

  • 0 — (Default) Standard calendar without nonbusiness day indicators.

  • 1 — Marks NYSE nonbusiness days in red.

'BusDaySelect'

Values are:

  • 0 — Only allow selection of business days. Nonbusiness days are determined from the following parameters:

    • 'BusDays'

    • 'Holiday'

    • 'Weekend'

  • 1 — (Default) Allows selections of business and nonbusiness days.

'DateBoxColor'

[date R G B] : Sets the color of the date squares to the specified [R G B] color.

'DateStrColor'

[date R G B] : Sets the color of the numeric date number in the date square to the specified [R G B] color.

'DestinationUI'

Values are:

  • H — Scalar or vector of the destination object's handles. The default UI property that is populated with the date(s) is 'string'.

  • {H, {Prop}} — Cell array of handles and the destination object's UI properties. H must be a scalar or vector and Prop must be a single property string or a cell array of property strings.

'Holiday'

Sets the specified holiday dates into the calendar. The corresponding date string of the holiday will appear Red. The Date(s) must be a scalar or vector of datenums.

'InitDate'

Values are:

  • Datenum — Numeric date value specifying the initial start date when the calendar is initialized. The default date is TODAY.

  • Datestr — Date string value specifying the initial start date when the calendar is initialized. Datestr must include a Year, Month, and Day (for example, 01-Jan-2006).

'InputDateFormat'

Format — Sets the format of initial start date, InitDate. See 'help datestr' for date format values.

'OutputDateFormat'

Format — Sets the format of output date string. See 'help datestr' for date format values.

'OutputDateStyle'

Values are:

  • 0 — (Default) Returns a single date string or a cell array (row) of date string. For example, {'01-Jan-2001, 02-Jan-2001, ...'}.

  • 1 — Returns a single date string or a cell (column) array of date strings. For example, {'01-Jan-2001; 02-Jan-2001; ...'}.

  • 2 — Returns a string representation of a row vector of datenums. For example, '[732758, 732759, 732760, 732761]'.

  • 3 — Returns a string representation of a column vector of datenums. For example, '[732758; 732759; 732760; 732761]'.

'SelectionType'

Values are:

  • 0 — Allows multiple date selections.

  • 1 — (Default) Allows only a single date selection.

'Weekend'

DayOfWeek — Sets the specified days of the week as weekend days. Weekend days are marked in red. DayOfWeek can be a vector containing the following numeric values:

  • 1 — Sunday

  • 2 — Monday

  • 3 — Tuesday

  • 4 — Wednesday

  • 5 — Thursday

  • 6 — Friday

  • 7 — Saturday

Also this value can be a vector of length 7 containing 0's and 1's. The value 1 indicates a weekend day. The first element of this vector corresponds to Sunday. For example, when Saturday and Sunday are weekend days then WEEKEND = [1 0 0 0 0 0 1].

'WindowStyle'

Values are:

  • Normal — (Default) Standard figure properties.

  • Modal — Modal figures remain stacked above all normal figures and the MATLAB® Command Window.

Description

uicalendar('PARAM1', VALUE1, 'PARAM2', VALUE2', ...) supports a customizable graphical calendar that interfaces with uicontrols. uicalendar populates uicontrols with user-selected dates.

Examples

Create a uicontrol:

textH1 = uicontrol('style', 'edit', 'position', [10 10 100 20]);       

Call UICalendar:

uicalendar('DestinationUI', {textH1, 'string'})

Select a date and click 'OK'.

For more information on using uicalendar with an application, see Example of Using UICalendar with an Application.

See Also

Was this topic helpful?