class sap.ui.unified.CalendarMonthInterval

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/unified/CalendarMonthInterval
Application Component: CA-UI5-CTR

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

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


Properties

Name Type Default Value Description
_currentPicker string monthsRow

Holds a reference to the currently shown picker. Possible values: monthsRow and yearPicker.

Since: 1.84.0.

Visibility: hidden
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 maxDate is set to be before the minDate, the minDate is set to the begin of the month of the maxDate.

Since: 1.38.0.

Visibility: public
minDate object

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.

Since: 1.38.0.

Visibility: public
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

Since: 1.34.0.

Visibility: public
singleSelection boolean true

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.

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 CalendarMonthInterval. The width of the single months depends on this width.

Visibility: public

Aggregations

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 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.

specialDates 0..n sap.ui.unified.DateTypeRange

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.

yearPicker 0..1 sap.ui.unified.calendar.YearPicker

Associations

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 CalendarLegend explaining the colors of the specialDates.

Note The legend does not have to be rendered but must exist, and all required types must be assigned.

Since: 1.38.5.


Events Overview

Event Description
cancel

Month selection was cancelled

select

Month selection changed

startDateChange

startDate was changed while navigation in CalendarMonthInterval

Since: 1.34.0.

cancel

Month selection was cancelled

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

select

Month selection changed

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

startDateChange

startDate was changed while navigation in CalendarMonthInterval

Since: 1.34.0.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

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 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

attachSelect

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

attachStartDateChange

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

destroySelectedDates

Destroys all the selectedDates in the aggregation selectedDates.

destroySpecialDates

Destroys all the specialDates in the aggregation specialDates.

detachCancel

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.

detachSelect

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.

detachStartDateChange

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.

displayDate

Displays a month in the CalendarMonthInterval but doesn't set the focus.

sap.ui.unified.CalendarMonthInterval.extend

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.

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 CalendarMonthInterval.

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 false.

getLegend

ID of the element which is the current target of the association legend, or null.

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 maxDate is set to be before the minDate, the minDate is set to the begin of the month of the maxDate.

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 minDate is set to be after the maxDate, the maxDate is set to the end of the month of the minDate.

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 12.

getPickerPopup

Gets current value of property pickerPopup.

If set, the yearPicker opens on a popup

Default value is false.

getSelectedDates

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.

getSingleSelection

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.

getSpecialDates

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.

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 CalendarMonthInterval. The width of the single months depends on this width.

indexOfSelectedDate

Checks for the provided sap.ui.unified.DateRange in the aggregation selectedDates. and returns its index if found or -1 otherwise.

indexOfSpecialDate

Checks for the provided sap.ui.unified.DateTypeRange in the aggregation specialDates. and returns its index if found or -1 otherwise.

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 null or undefined, the default value of the property will be restored.

Default value is false.

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 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.

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 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.

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 null or undefined, the default value of the property will be restored.

Default value is 12.

setPickerPopup

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.

setSingleSelection

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.

setWidth

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.

addAriaLabelledBy

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

addSelectedDate

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

addSpecialDate

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

attachCancel

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 sap.ui.unified.CalendarMonthInterval itself

attachSelect

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 sap.ui.unified.CalendarMonthInterval itself

attachStartDateChange

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 sap.ui.unified.CalendarMonthInterval itself

destroySelectedDates

Destroys all the selectedDates in the aggregation selectedDates.

destroySpecialDates

Destroys all the specialDates in the aggregation specialDates.

detachCancel

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

detachSelect

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

detachStartDateChange

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

displayDate

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.)

sap.ui.unified.CalendarMonthInterval.extend

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

fireCancel

Fires event cancel to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireSelect

Fires event select to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireStartDateChange

Fires event startDateChange to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

focusDate

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.)

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 false.

getLegend

ID of the element which is the current target of the association legend, or null.

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 maxDate is set to be before the minDate, the minDate is set to the begin of the month of the maxDate.

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 minDate is set to be after the maxDate, the maxDate is set to the end of the month of the minDate.

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 12.

getPickerPopup

Gets current value of property pickerPopup.

If set, the yearPicker opens on a popup

Default value is false.

getSelectedDates

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.

getSingleSelection

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.

getSpecialDates

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.

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 CalendarMonthInterval. The width of the single months depends on this width.

indexOfSelectedDate

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

indexOfSpecialDate

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

insertSelectedDate

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 0-based index the selectedDate should be inserted at; for a negative value of iIndex, the selectedDate is inserted at position 0; for a value greater than the current size of the aggregation, the selectedDate is inserted at the last position

insertSpecialDate

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 0-based index the specialDate should be inserted at; for a negative value of iIndex, the specialDate is inserted at position 0; for a value greater than the current size of the aggregation, the specialDate is inserted at the last position

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.

Param Type DefaultValue Description
vAriaLabelledBy int sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to be removed or its index or ID

removeSelectedDate

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

removeSpecialDate

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

setIntervalSelection

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 intervalSelection

setLegend

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

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 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 maxDate

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 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 minDate

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 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 months

setPickerPopup

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 pickerPopup

setSingleSelection

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 singleSelection

setWidth

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 width