uicalendar
Graphical calendar
Syntax
Description
uicalendar(
supports a customizable graphical calendar that interfaces with one or moreName,Value
)uicontrol
.uicalendar
populates one or moreuicontrol
with user-selected dates.
Note
As an alternative touicalendar
, you can useuidatepicker
.
Examples
Useuicalendar
with anuicontrol
Create anuicontrol
:
textH1 = uicontrol('style','edit','position', [10 10 100 20])
textH1 = UIControl with properties: Style: 'edit' String: '' BackgroundColor: [0.9400 0.9400 0.9400] Callback: '' Value: 0 Position: [10 10 100 20] Units: 'pixels'
Call UICalendar:
uicalendar('DestinationUI', {textH1,'string'})
Select a date and clickOK
.
Alternatively, you can use datetime arrays forInitDate
andHoliday
.
uicalendar('InitDate',datetime('15-Mar-2015','Locale','en_US'),'Holiday',datetime('16-Mar-2015','Locale','en_US'))
Select a date and clickOK
. For more information on usinguicalendar
with an application, seeExample of Using UICalendar with an Application.
Input Arguments
Name-Value Arguments
Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN
, whereName
is the argument name andValue
is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.
Before R2021a, use commas to separate each name and value, and encloseName
in quotes.
Example:uicalendar('InitDate',datetime('15-Mar-2015','Locale','en_US'),'Holiday',datetime('16-Mar-2015','Locale','en_US'))
BusDays
—Flag to indicate nonbusiness days
0
(Standard calendar without nonbusiness day indicators)(default) |numeric values of0
or1
Flag to indicate nonbusiness days, specified using numeric values of0
or1
. The values are:
0
— (Default) Standard calendar without nonbusiness day indicators.
1
— Marks NYSE nonbusiness days in red.
Data Types:logical
BusDaySelect
—Flag to indicate whether business and nonbusiness days
1
(Allows selections of business and nonbusiness days)(default) |numeric values of0
or1
Flag to indicate whether business and nonbusiness days, specified using numeric values of0
or1
. The 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.
Data Types:logical
DateBoxColor
—Color of date squares
[date R G B]
Color of date squares, specified using[date R G B]
, where[R G B]
is the color.
Data Types:double
DateStrColor
—Color of numeric date number in the date square
[date R G B]
Color of numeric date number in the date square, specified using[date R G B]
, where[R G B]
is the color.
Data Types:double
DestinationUI
—Destination object's handles
'string'
(default UI property populated with dates)(default) |values areH
or{H, {Prop}}
Destination object's handles, specified with valuesH
or{H, {Prop}}
. The values are:
H
— Scalar or vector of the destination object's handles. The default UI property that is populated with the dates is a character vector.
{H, {Prop}}
— Cell array of handles and the destination object's UI properties.H
must be a scalar or vector andProp
must be a single property character vector or a cell array of property character vectors.
Data Types:char
|cell
Holiday
—Holiday dates in calendar
serial date numbers|datetime arrays
Holiday dates in calendar, specified using a scalar or vector of serial date numbers or datetime arrays. The corresponding date character vector of the holiday appears Red.
Data Types:double
|datetime
InitDate
—Initial start date when calendar is initialized
TODAY
(default) |serial date number|datetime array|date character vector
Initial start date when calendar is initialized, specified with date values using a serial date number, datetime array, or date character vector. The values are:
Datenum
— Numeric or datetime array date value specifying the initial start date when the calendar is initialized. The default date isTODAY
.
Datestr
— Date character vector value specifying the initial start date when the calendar is initialized.Datestr
must include a Year, Month, and Day (for example, 01-Jan-2006).
Data Types:double
|char
|datetime
OutputDateFormat
—Format of output date
character vector
Format of output date, specified using a character vector. Seedatestr
for date format values.
Data Types:double
|datetime
OutputDateStyle
—Style for output date
0
(default) |numeric value of0
,1
,2
, or3
Style for output date, specified using a value of0
,1
,2
, or3
. The values are:
0
— (Default) Returns a single date character vector or a cell array (row) of date character vectors. For example,{'01-Jan-2001, 02-Jan-2001, ...'}
.
1
— Returns a single date character vector or a cell (column) array of date character vectors. For example,{'01-Jan-2001; 02-Jan-2001; ...'}
.
2
— Returns a character vector representation of a row vector of datenums. For example,'[732758, 732759, 732760, 732761]'
.
3
— Returns a character vector representation of a column vector of datenums. For example,'[732758; 732759; 732760; 732761]'
.
Data Types:double
SelectionType
—Flag for date selection
1
(default) |numeric value of0
or1
Flag for date selection, specified with using a value of0
or1
. The values are:
0
— Allows multiple date selections.
1
— (Default) Allows only a single date selection.
Data Types:logical
Weekend
—Define weekend days
1
(default) |numeric values of1
through7
定义周末,指定使用的价值1
through7
. Weekend days are marked in red.DayOfWeek
can be a vector containing the following numeric values:
1
— Sunday2
— Monday3
— Tuesday4
— Wednesday5
— Thursday6
— Friday7
— Saturday
Also this value can be a vector of length7
有限公司ntaining0
's and1
's. The value1
表示周末的一天。它的第一个元素vector corresponds to Sunday. For example, when Saturday and Sunday are weekend days thenWEEKEND
=[1 0 0 0 0 0 1]
.
Data Types:double
WindowStyle
—Window figure properties
Normal
(default) |character vector with value ofNormal
orModal
Window figure properties, specified with using a character vector with a value ofNormal
orModal
. The values are:
Normal
— (Default) Standard figure properties.
Modal
— Modal figures remain stacked above all normal figures and the MATLAB®Command Window.
Data Types:char
Version History
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)