Class sap.ui.unified.CalendarMonthIntervalModule: sap/ui/unified/CalendarMonthInterval

extends Control

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.


Since: 1.32.0.
Constructor Summary
new sap.ui.unified.CalendarMonthInterval(sId?, mSettings?)Constructor for a new CalendarMonthInterval.
Event Summary
cancel(oControlEvent)Month selection was cancelled
select(oControlEvent)Month selection changed
startDateChange(oControlEvent)startDate was changed while navigation in CalendarMonthInterval
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.unified.CalendarMonthInterval.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.unified.CalendarMonthInterval with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.unified.CalendarMonthInterval.getMetadata()Returns a metadata object for class sap.ui.unified.CalendarMonthInterval.
addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy.
addSelectedDate(oSelectedDate)Adds some selectedDate to the aggregation selectedDates.
addSpecialDate(oSpecialDate)Adds some specialDate to the aggregation specialDates.
attachCancel(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the cancel event of this sap.ui.unified.CalendarMonthInterval.
attachSelect(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the select event of this sap.ui.unified.CalendarMonthInterval.
attachStartDateChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the startDateChange event of this sap.ui.unified.CalendarMonthInterval.
destroySelectedDates()Destroys all the selectedDates in the aggregation selectedDates.
destroySpecialDates()Destroys all the specialDates in the aggregation specialDates.
detachCancel(fnFunction, oListener)Detaches event handler fnFunction from the cancel event of this sap.ui.unified.CalendarMonthInterval.
detachSelect(fnFunction, oListener)Detaches event handler fnFunction from the select event of this sap.ui.unified.CalendarMonthInterval.
detachStartDateChange(fnFunction, oListener)Detaches event handler fnFunction from the startDateChange event of this sap.ui.unified.CalendarMonthInterval.
displayDate(oDatetime)Displays a month in the CalendarMonthInterval but doesn't set the focus.
fireCancel(mParameters?)Fires event cancel to attached listeners.
fireSelect(mParameters?)Fires event select to attached listeners.
fireStartDateChange(mParameters?)Fires event startDateChange to attached listeners.
focusDate(oDatetime)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.
getLegend()ID of the element which is the current target of the association legend, or null.
getMaxDate()Gets current value of property maxDate.
getMinDate()Gets current value of property minDate.
getMonths()Gets current value of property months.
getPickerPopup()Gets current value of property pickerPopup.
getSelectedDates()Gets content of aggregation selectedDates.
getSingleSelection()Gets current value of property singleSelection.
getSpecialDates()Gets content of aggregation specialDates.
getStartDate()Gets current value of property startDate.
getWidth()Gets current value of property width.
indexOfSelectedDate(oSelectedDate)Checks for the provided sap.ui.unified.DateRange in the aggregation selectedDates.
indexOfSpecialDate(oSpecialDate)Checks for the provided sap.ui.unified.DateTypeRange in the aggregation specialDates.
insertSelectedDate(oSelectedDate, iIndex)Inserts a selectedDate into the aggregation selectedDates.
insertSpecialDate(oSpecialDate, iIndex)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.
removeAllSpecialDates()Removes all the controls from the aggregation specialDates.
removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy.
removeSelectedDate(vSelectedDate)Removes a selectedDate from the aggregation selectedDates.
removeSpecialDate(vSpecialDate)Removes a specialDate from the aggregation specialDates.
setIntervalSelection(bIntervalSelection)Sets a new value for property intervalSelection.
setLegend(oLegend)Sets the associated legend.
setMonths(iMonths)Sets a new value for property months.
setPickerPopup(bPickerPopup)Sets a new value for property pickerPopup.
setSingleSelection(bSingleSelection)Sets a new value for property singleSelection.
setWidth(sWidth)Sets a new value for property width.
Constructor Detail
new sap.ui.unified.CalendarMonthInterval(sId?, mSettings?)

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 for a general description of the syntax of the settings object.

The supported settings are:

  • Properties

  • Aggregations

  • Associations

    • ariaLabelledBy : (sap.ui.core.ID | sap.ui.core.Control)[]
    • legend : (sap.ui.core.ID | sap.ui.unified.CalendarLegend)

  • Events

    • select : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • cancel : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • startDateChange : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
stringsId?ID for the new control, generated automatically if no ID is given
ObjectmSettings?Initial settings for the new control
Event Detail
cancel(oControlEvent)
Month selection was cancelled
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
select(oControlEvent)
Month selection changed
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
startDateChange(oControlEvent)
startDate was changed while navigation in CalendarMonthInterval
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
Since:
1.34.0
Method Detail
sap.ui.unified.CalendarMonthInterval.extend(sClassName, oClassInfo?, FNMetaImpl?): function

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.

Parameters:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.ui.unified.CalendarMonthInterval.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.unified.CalendarMonthInterval.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addAriaLabelledBy(vAriaLabelledBy): sap.ui.unified.CalendarMonthInterval
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledBythe ariaLabelledBy to add; if empty, nothing is inserted
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
addSelectedDate(oSelectedDate): sap.ui.unified.CalendarMonthInterval
Adds some selectedDate to the aggregation selectedDates.
Parameters:
sap.ui.unified.DateRangeoSelectedDatethe selectedDate to add; if empty, nothing is inserted
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
addSpecialDate(oSpecialDate): sap.ui.unified.CalendarMonthInterval
Adds some specialDate to the aggregation specialDates.
Parameters:
sap.ui.unified.DateTypeRangeoSpecialDatethe specialDate to add; if empty, nothing is inserted
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
attachCancel(oData?, fnFunction, oListener?): sap.ui.unified.CalendarMonthInterval

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

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.unified.CalendarMonthInterval itself
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
attachSelect(oData?, fnFunction, oListener?): sap.ui.unified.CalendarMonthInterval

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

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.unified.CalendarMonthInterval itself
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
attachStartDateChange(oData?, fnFunction, oListener?): sap.ui.unified.CalendarMonthInterval

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

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.unified.CalendarMonthInterval itself
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
Since:
1.34.0
destroySelectedDates(): sap.ui.unified.CalendarMonthInterval
Destroys all the selectedDates in the aggregation selectedDates.
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
destroySpecialDates(): sap.ui.unified.CalendarMonthInterval
Destroys all the specialDates in the aggregation specialDates.
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
detachCancel(fnFunction, oListener): sap.ui.unified.CalendarMonthInterval

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.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
detachSelect(fnFunction, oListener): sap.ui.unified.CalendarMonthInterval

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.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
detachStartDateChange(fnFunction, oListener): sap.ui.unified.CalendarMonthInterval

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.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
Since:
1.34.0
displayDate(oDatetime): sap.ui.unified.CalendarMonthInterval
Displays a month in the CalendarMonthInterval but doesn't set the focus.
Parameters:
ObjectoDatetimeJavaScript date object for displayed date. (The month of this date will be displayed.)
Returns:
sap.ui.unified.CalendarMonthIntervalthis to allow method chaining
fireCancel(mParameters?): sap.ui.unified.CalendarMonthInterval
Fires event cancel to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
fireSelect(mParameters?): sap.ui.unified.CalendarMonthInterval
Fires event select to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
fireStartDateChange(mParameters?): sap.ui.unified.CalendarMonthInterval
Fires event startDateChange to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
Since:
1.34.0
focusDate(oDatetime): sap.ui.unified.Calendar
Sets the focused month of the CalendarMonthInterval.
Parameters:
ObjectoDatetimeJavaScript date object for focused date. (The month of this date will be focused.)
Returns:
sap.ui.unified.Calendarthis to allow method chaining
getAriaLabelledBy(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns:
sap.ui.core.ID[]
getIntervalSelection(): boolean

Gets current value of property intervalSelection.

If set, interval selection is allowed

Default value is false.

Returns:
booleanValue of property intervalSelection
getLegend(): sap.ui.core.ID
ID of the element which is the current target of the association legend, or null.
Returns:
sap.ui.core.ID
Since:
1.38.5
getMaxDate(): object

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:
objectValue of property maxDate
Since:
1.38.0
getMinDate(): object

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.

Returns:
objectValue of property minDate
Since:
1.38.0
getMonths(): int

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.

Returns:
intValue of property months
getPickerPopup(): boolean

Gets current value of property pickerPopup.

If set, the yearPicker opens on a popup

Default value is false.

Returns:
booleanValue of property pickerPopup
Since:
1.34.0
getSelectedDates(): sap.ui.unified.DateRange[]

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.

Returns:
sap.ui.unified.DateRange[]
getSingleSelection(): boolean

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.

Returns:
booleanValue of property singleSelection
getSpecialDates(): sap.ui.unified.DateTypeRange[]

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.

Returns:
sap.ui.unified.DateTypeRange[]
getStartDate(): object

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.

Returns:
objectValue of property startDate
getWidth(): sap.ui.core.CSSSize

Gets current value of property width.

Width of the CalendarMonthInterval. The width of the single months depends on this width.

Returns:
sap.ui.core.CSSSizeValue of property width
indexOfSelectedDate(oSelectedDate): int
Checks for the provided sap.ui.unified.DateRange in the aggregation selectedDates. and returns its index if found or -1 otherwise.
Parameters:
sap.ui.unified.DateRangeoSelectedDateThe selectedDate whose index is looked for
Returns:
intThe index of the provided control in the aggregation if found, or -1 otherwise
indexOfSpecialDate(oSpecialDate): int
Checks for the provided sap.ui.unified.DateTypeRange in the aggregation specialDates. and returns its index if found or -1 otherwise.
Parameters:
sap.ui.unified.DateTypeRangeoSpecialDateThe specialDate whose index is looked for
Returns:
intThe index of the provided control in the aggregation if found, or -1 otherwise
insertSelectedDate(oSelectedDate, iIndex): sap.ui.unified.CalendarMonthInterval
Inserts a selectedDate into the aggregation selectedDates.
Parameters:
sap.ui.unified.DateRangeoSelectedDatethe selectedDate to insert; if empty, nothing is inserted
intiIndexthe 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
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
insertSpecialDate(oSpecialDate, iIndex): sap.ui.unified.CalendarMonthInterval
Inserts a specialDate into the aggregation specialDates.
Parameters:
sap.ui.unified.DateTypeRangeoSpecialDatethe specialDate to insert; if empty, nothing is inserted
intiIndexthe 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
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
removeAllAriaLabelledBy(): sap.ui.core.ID[]
Removes all the controls in the association named ariaLabelledBy.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
removeAllSelectedDates(): sap.ui.unified.DateRange[]

Removes all the controls from the aggregation selectedDates.

Additionally, it unregisters them from the hosting UIArea.

Returns:
sap.ui.unified.DateRange[]An array of the removed elements (might be empty)
removeAllSpecialDates(): sap.ui.unified.DateTypeRange[]

Removes all the controls from the aggregation specialDates.

Additionally, it unregisters them from the hosting UIArea.

Returns:
sap.ui.unified.DateTypeRange[]An array of the removed elements (might be empty)
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.ID
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
int|sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledByThe ariaLabelledBy to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed ariaLabelledBy or null
removeSelectedDate(vSelectedDate): sap.ui.unified.DateRange
Removes a selectedDate from the aggregation selectedDates.
Parameters:
int|string|sap.ui.unified.DateRangevSelectedDateThe selectedDate to remove or its index or id
Returns:
sap.ui.unified.DateRangeThe removed selectedDate or null
removeSpecialDate(vSpecialDate): sap.ui.unified.DateTypeRange
Removes a specialDate from the aggregation specialDates.
Parameters:
int|string|sap.ui.unified.DateTypeRangevSpecialDateThe specialDate to remove or its index or id
Returns:
sap.ui.unified.DateTypeRangeThe removed specialDate or null
setIntervalSelection(bIntervalSelection): sap.ui.unified.CalendarMonthInterval

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.

Parameters:
booleanbIntervalSelectionNew value for property intervalSelection
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
Sets the associated legend.
Parameters:
sap.ui.core.ID|sap.ui.unified.CalendarLegendoLegendID of an element which becomes the new target of this legend association; alternatively, an element instance may be given
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
Since:
1.38.5

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.

Parameters:
intiMonthsNew value for property months
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
setPickerPopup(bPickerPopup): sap.ui.unified.CalendarMonthInterval

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.

Parameters:
booleanbPickerPopupNew value for property pickerPopup
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining
Since:
1.34.0
setSingleSelection(bSingleSelection): sap.ui.unified.CalendarMonthInterval

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.

Parameters:
booleanbSingleSelectionNew value for property singleSelection
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining

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.

Parameters:
sap.ui.core.CSSSizesWidthNew value for property width
Returns:
sap.ui.unified.CalendarMonthIntervalReference to this in order to allow method chaining