Calendar with granularity of months displayed in one line.
Note: JavaScript Date objects are used to set and return the months, mark them as selected or as a special type. But the date part of the Date object is not used. If a Date object is returned the date will be set to the 1st of the corresponding month.
Constructor for a new CalendarMonthInterval
.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new sap.ui.unified.CalendarMonthInterval(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new control, generated automatically if no ID is given |
|
mSettings? | Object | Initial settings for the new control |
Name | Type | Default Value | Description |
---|---|---|---|
_currentPicker | string | monthsRow | Holds a reference to the currently shown picker. Possible values: monthsRow and yearPicker. |
intervalSelection | boolean | false | If set, interval selection is allowed Visibility: public |
maxDate | object | Maximum date that can be shown and selected in the Calendar. This must be a JavaScript date object. Note: If the |
|
minDate | object | Minimum date that can be shown and selected in the Calendar. This must be a JavaScript date object. Note: If the |
|
months | int | 12 | Number of months displayed Note: On phones, the maximum number of months displayed in the row is always 6. Visibility: public |
pickerPopup | boolean | false | If set, the yearPicker opens on a popup |
singleSelection | boolean | true | If set, only a single date or interval, if Note: Selection of multiple intervals is not supported in the current version. Visibility: public |
startDate | object | Start date of the Interval as JavaScript Date object. The month of this Date will be the first month in the displayed row. Visibility: public |
|
width | sap.ui.core.CSSSize | Width of the |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
header | 0..1 | sap.ui.unified.calendar.Header |
Hidden, for internal use only. |
monthsRow | 0..1 | sap.ui.unified.calendar.MonthsRow | |
selectedDates | 0..n | sap.ui.unified.DateRange |
Date ranges for selected dates of the If Note: Even if only one day is selected, the whole corresponding month is selected. |
specialDates | 0..n | sap.ui.unified.DateTypeRange |
Date ranges with type to visualize special months in the Note: Even if only one day is set as a special day, the whole corresponding month is displayed in this way. |
yearPicker | 0..1 | sap.ui.unified.calendar.YearPicker |
Name | Cardinality | Type | Description |
---|---|---|---|
ariaLabelledBy | 0..n | sap.ui.core.Control |
Association to controls / IDs which label this control (see WAI-ARIA attribute aria-labelledby). |
legend | 0..1 | sap.ui.unified.CalendarLegend |
Association to the Note The legend does not have to be rendered but must exist, and all required types must be assigned. |
Event | Description |
---|---|
cancel |
Month selection was cancelled |
select |
Month selection changed |
startDateChange |
|
Month selection was cancelled
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
Method | Description |
---|---|
addAriaLabelledBy |
Adds some ariaLabelledBy into the association ariaLabelledBy. |
addSelectedDate |
Adds some selectedDate to the aggregation selectedDates. |
addSpecialDate |
Adds some specialDate to the aggregation specialDates. |
attachCancel |
Attaches event handler When called, the context of the event handler (its Month selection was cancelled |
attachSelect |
Attaches event handler When called, the context of the event handler (its Month selection changed |
attachStartDateChange |
Attaches event handler When called, the context of the event handler (its
|
destroySelectedDates |
Destroys all the selectedDates in the aggregation selectedDates. |
destroySpecialDates |
Destroys all the specialDates in the aggregation specialDates. |
detachCancel |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachSelect |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachStartDateChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
displayDate |
Displays a month in the |
sap.ui.unified.CalendarMonthInterval.extend |
Creates a new subclass of class sap.ui.unified.CalendarMonthInterval with name
|
fireCancel |
Fires event cancel to attached listeners. |
fireSelect |
Fires event select to attached listeners. |
fireStartDateChange |
Fires event startDateChange to attached listeners. |
focusDate |
Sets the focused month of the |
getAriaLabelledBy |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy. |
getIntervalSelection |
Gets current value of property intervalSelection. If set, interval selection is allowed Default value is |
getLegend |
ID of the element which is the current target of the association legend, or |
getMaxDate |
Gets current value of property maxDate. Maximum date that can be shown and selected in the Calendar. This must be a JavaScript date object. Note: If the |
sap.ui.unified.CalendarMonthInterval.getMetadata |
Returns a metadata object for class sap.ui.unified.CalendarMonthInterval. |
getMinDate |
Gets current value of property minDate. Minimum date that can be shown and selected in the Calendar. This must be a JavaScript date object. Note: If the |
getMonths |
Gets current value of property months. Number of months displayed Note: On phones, the maximum number of months displayed in the row is always 6. Default value is |
getPickerPopup |
Gets current value of property pickerPopup. If set, the yearPicker opens on a popup Default value is |
getSelectedDates |
Gets content of aggregation selectedDates. Date ranges for selected dates of the If Note: Even if only one day is selected, the whole corresponding month is selected. |
getSingleSelection |
Gets current value of property singleSelection. If set, only a single date or interval, if Note: Selection of multiple intervals is not supported in the current version. Default value is |
getSpecialDates |
Gets content of aggregation specialDates. Date ranges with type to visualize special months in the Note: Even if only one day is set as a special day, the whole corresponding month is displayed in this way. |
getStartDate |
Gets current value of property startDate. Start date of the Interval as JavaScript Date object. The month of this Date will be the first month in the displayed row. |
getWidth |
Gets current value of property width. Width of the |
indexOfSelectedDate |
Checks for the provided |
indexOfSpecialDate |
Checks for the provided |
insertSelectedDate |
Inserts a selectedDate into the aggregation selectedDates. |
insertSpecialDate |
Inserts a specialDate into the aggregation specialDates. |
removeAllAriaLabelledBy |
Removes all the controls in the association named ariaLabelledBy. |
removeAllSelectedDates |
Removes all the controls from the aggregation selectedDates. Additionally, it unregisters them from the hosting UIArea. |
removeAllSpecialDates |
Removes all the controls from the aggregation specialDates. Additionally, it unregisters them from the hosting UIArea. |
removeAriaLabelledBy |
Removes an ariaLabelledBy from the association named ariaLabelledBy. |
removeSelectedDate |
Removes a selectedDate from the aggregation selectedDates. |
removeSpecialDate |
Removes a specialDate from the aggregation specialDates. |
setIntervalSelection |
Sets a new value for property intervalSelection. If set, interval selection is allowed When called with a value of Default value is |
setLegend |
Sets the associated legend. |
setMaxDate |
Sets a new value for property maxDate. Maximum date that can be shown and selected in the Calendar. This must be a JavaScript date object. Note: If the When called with a value of |
setMinDate |
Sets a new value for property minDate. Minimum date that can be shown and selected in the Calendar. This must be a JavaScript date object. Note: If the When called with a value of |
setMonths |
Sets a new value for property months. Number of months displayed Note: On phones, the maximum number of months displayed in the row is always 6. When called with a value of Default value is |
setPickerPopup |
Sets a new value for property pickerPopup. If set, the yearPicker opens on a popup When called with a value of Default value is |
setSingleSelection |
Sets a new value for property singleSelection. If set, only a single date or interval, if Note: Selection of multiple intervals is not supported in the current version. When called with a value of Default value is |
setWidth |
Sets a new value for property width. Width of the When called with a value of |
Adds some ariaLabelledBy into the association ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to add; if empty, nothing is inserted |
Adds some selectedDate to the aggregation selectedDates.
Param | Type | DefaultValue | Description |
---|---|---|---|
oSelectedDate | sap.ui.unified.DateRange |
The selectedDate to add; if empty, nothing is inserted |
Adds some specialDate to the aggregation specialDates.
Param | Type | DefaultValue | Description |
---|---|---|---|
oSpecialDate | sap.ui.unified.DateTypeRange |
The specialDate to add; if empty, nothing is inserted |
Attaches event handler fnFunction
to the cancel event of this sap.ui.unified.CalendarMonthInterval
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.unified.CalendarMonthInterval
itself.
Month selection was cancelled
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the select event of this sap.ui.unified.CalendarMonthInterval
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.unified.CalendarMonthInterval
itself.
Month selection changed
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Attaches event handler fnFunction
to the startDateChange event of this sap.ui.unified.CalendarMonthInterval
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.unified.CalendarMonthInterval
itself.
startDate
was changed while navigation in CalendarMonthInterval
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Detaches event handler fnFunction
from the cancel event of this sap.ui.unified.CalendarMonthInterval
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the select event of this sap.ui.unified.CalendarMonthInterval
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Detaches event handler fnFunction
from the startDateChange event of this sap.ui.unified.CalendarMonthInterval
.
The passed function and listener object must match the ones used for event registration.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
Displays a month in the CalendarMonthInterval
but doesn't set the focus.
Param | Type | DefaultValue | Description |
---|---|---|---|
oDatetime | Object |
JavaScript date object for displayed date. (The month of this date will be displayed.) |
Creates a new subclass of class sap.ui.unified.CalendarMonthInterval with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.core.Control.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires event cancel to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event select to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event startDateChange to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Sets the focused month of the CalendarMonthInterval
.
Param | Type | DefaultValue | Description |
---|---|---|---|
oDatetime | Object |
JavaScript date object for focused date. (The month of this date will be focused.) |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Gets current value of property intervalSelection.
If set, interval selection is allowed
Default value is false
.
Gets current value of property maxDate.
Maximum date that can be shown and selected in the Calendar. This must be a JavaScript date object.
Note: If the maxDate
is set to be before the minDate
, the minDate
is set to the begin of the month of the maxDate
.
Returns a metadata object for class sap.ui.unified.CalendarMonthInterval.
Gets current value of property minDate.
Minimum date that can be shown and selected in the Calendar. This must be a JavaScript date object.
Note: If the minDate
is set to be after the maxDate
, the maxDate
is set to the end of the month of the minDate
.
Gets current value of property months.
Number of months displayed
Note: On phones, the maximum number of months displayed in the row is always 6.
Default value is 12
.
Gets current value of property pickerPopup.
If set, the yearPicker opens on a popup
Default value is false
.
Gets content of aggregation selectedDates.
Date ranges for selected dates of the CalendarMonthInterval
.
If singleSelection
is set, only the first entry is used.
Note: Even if only one day is selected, the whole corresponding month is selected.
Gets current value of property singleSelection.
If set, only a single date or interval, if intervalSelection
is enabled, can be selected
Note: Selection of multiple intervals is not supported in the current version.
Default value is true
.
Gets content of aggregation specialDates.
Date ranges with type to visualize special months in the CalendarMonthInterval
. If one day is assigned to more than one type, only the first one will be used.
Note: Even if only one day is set as a special day, the whole corresponding month is displayed in this way.
Gets current value of property startDate.
Start date of the Interval as JavaScript Date object. The month of this Date will be the first month in the displayed row.
Gets current value of property width.
Width of the CalendarMonthInterval
. The width of the single months depends on this width.
Checks for the provided sap.ui.unified.DateRange
in the aggregation selectedDates. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oSelectedDate | sap.ui.unified.DateRange |
The selectedDate whose index is looked for |
Checks for the provided sap.ui.unified.DateTypeRange
in the aggregation specialDates. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oSpecialDate | sap.ui.unified.DateTypeRange |
The specialDate whose index is looked for |
Inserts a selectedDate into the aggregation selectedDates.
Param | Type | DefaultValue | Description |
---|---|---|---|
oSelectedDate | sap.ui.unified.DateRange |
The selectedDate to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Inserts a specialDate into the aggregation specialDates.
Param | Type | DefaultValue | Description |
---|---|---|---|
oSpecialDate | sap.ui.unified.DateTypeRange |
The specialDate to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Removes all the controls from the aggregation selectedDates.
Additionally, it unregisters them from the hosting UIArea.
Removes all the controls from the aggregation specialDates.
Additionally, it unregisters them from the hosting UIArea.
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | int sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to be removed or its index or ID |
Removes a selectedDate from the aggregation selectedDates.
Param | Type | DefaultValue | Description |
---|---|---|---|
vSelectedDate | int string sap.ui.unified.DateRange |
The selectedDate to remove or its index or id |
Removes a specialDate from the aggregation specialDates.
Param | Type | DefaultValue | Description |
---|---|---|---|
vSpecialDate | int string sap.ui.unified.DateTypeRange |
The specialDate to remove or its index or id |
Sets a new value for property intervalSelection.
If set, interval selection is allowed
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bIntervalSelection | boolean | false |
New value for property |
Sets the associated legend.
Param | Type | DefaultValue | Description |
---|---|---|---|
oLegend | sap.ui.core.ID sap.ui.unified.CalendarLegend |
ID of an element which becomes the new target of this legend association; alternatively, an element instance may be given |
Sets a new value for property maxDate.
Maximum date that can be shown and selected in the Calendar. This must be a JavaScript date object.
Note: If the maxDate
is set to be before the minDate
, the minDate
is set to the begin of the month of the maxDate
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
oMaxDate | object |
New value for property |
Sets a new value for property minDate.
Minimum date that can be shown and selected in the Calendar. This must be a JavaScript date object.
Note: If the minDate
is set to be after the maxDate
, the maxDate
is set to the end of the month of the minDate
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
oMinDate | object |
New value for property |
Sets a new value for property months.
Number of months displayed
Note: On phones, the maximum number of months displayed in the row is always 6.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 12
.
Param | Type | DefaultValue | Description |
---|---|---|---|
iMonths | int | 12 |
New value for property |
Sets a new value for property pickerPopup.
If set, the yearPicker opens on a popup
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bPickerPopup | boolean | false |
New value for property |
Sets a new value for property singleSelection.
If set, only a single date or interval, if intervalSelection
is enabled, can be selected
Note: Selection of multiple intervals is not supported in the current version.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bSingleSelection | boolean | true |
New value for property |
Sets a new value for property width.
Width of the CalendarMonthInterval
. The width of the single months depends on this width.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize |
New value for property |