class sap.ui.unified.calendar.MonthPicker

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

renders a MonthPicker with ItemNavigation This is used inside the calendar. Not for stand alone usage


Constructor

Constructor for a new MonthPicker.

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.calendar.MonthPicker(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
_firstMonth int 0

The first displayed month. The value must be between 0 and 11

Visibility: hidden
_focusedMonth int

The focused month. The value must be between 0 and 11

Visibility: hidden
columns int 3

number of months in each row The value must be between 0 and 12 (0 means just to have all months in one row, independent of the number)

Since: 1.30.0.

Visibility: public
intervalSelection boolean false

If set, interval selection is allowed

Since: 1.74.

Visibility: public
month int 0

The month is initial focused and selected The value must be between 0 and 11

Visibility: public
months int 12

number of displayed months The value must be between 1 and 12

Since: 1.30.0.

Visibility: public
primaryCalendarType sap.ui.core.CalendarType

If set, the calendar type is used for display. If not set, the calendar type of the global configuration is used.

Since: 1.34.0.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
selectedDates 0..n sap.ui.unified.DateRange

Date Ranges for selected dates of the MonthPicker

Since: 1.74.


Associations

Name Cardinality Type Description
ariaLabelledBy 0..n sap.ui.core.Control

Association to controls / IDs that label this control (see WAI-ARIA attribute aria-labelledby).

Since: 1.92.


Events Overview

Event Description
pageChange

If less than 12 months are displayed the pageChange event is fired if the displayed months are changed by user navigation.

Since: 1.38.0.

select

Month selection changed

pageChange

If less than 12 months are displayed the pageChange event is fired if the displayed months are changed by user navigation.

Since: 1.38.0.

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

Methods Overview

Method Description
addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

addSelectedDate

Adds some selectedDate to the aggregation selectedDates.

attachPageChange

Attaches event handler fnFunction to the pageChange event of this sap.ui.unified.calendar.MonthPicker.

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.calendar.MonthPicker itself.

If less than 12 months are displayed the pageChange event is fired if the displayed months are changed by user navigation.

attachSelect

Attaches event handler fnFunction to the select event of this sap.ui.unified.calendar.MonthPicker.

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.calendar.MonthPicker itself.

Month selection changed

destroySelectedDates

Destroys all the selectedDates in the aggregation selectedDates.

detachPageChange

Detaches event handler fnFunction from the pageChange event of this sap.ui.unified.calendar.MonthPicker.

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

The passed function and listener object must match the ones used for event registration.

sap.ui.unified.calendar.MonthPicker.extend

Creates a new subclass of class sap.ui.unified.calendar.MonthPicker 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.

firePageChange

Fires event pageChange to attached listeners.

fireSelect

Fires event select to attached listeners.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getColumns

Gets current value of property columns.

number of months in each row The value must be between 0 and 12 (0 means just to have all months in one row, independent of the number)

Default value is 3.

getIntervalSelection

Gets current value of property intervalSelection.

If set, interval selection is allowed

Default value is false.

sap.ui.unified.calendar.MonthPicker.getMetadata

Returns a metadata object for class sap.ui.unified.calendar.MonthPicker.

getMonth

Gets current value of property month.

The month is initial focused and selected The value must be between 0 and 11

Default value is 0.

getMonths

Gets current value of property months.

number of displayed months The value must be between 1 and 12

Default value is 12.

getPrimaryCalendarType

Gets current value of property primaryCalendarType.

If set, the calendar type is used for display. If not set, the calendar type of the global configuration is used.

getSelectedDates

Gets content of aggregation selectedDates.

Date Ranges for selected dates of the MonthPicker

indexOfSelectedDate

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

insertSelectedDate

Inserts a selectedDate into the aggregation selectedDates.

nextPage

displays the next page

previousPage

displays the previous page

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.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

removeSelectedDate

Removes a selectedDate from the aggregation selectedDates.

setColumns

Sets a new value for property columns.

number of months in each row The value must be between 0 and 12 (0 means just to have all months in one row, independent of the number)

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 3.

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.

setMinMax

sets a minimum and maximum month

setMonth

Sets a new value for property month.

The month is initial focused and selected The value must be between 0 and 11

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 0.

setMonths

Sets a new value for property months.

number of displayed months The value must be between 1 and 12

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 12.

setPrimaryCalendarType

Sets a new value for property primaryCalendarType.

If set, the calendar type is used for display. If not set, the calendar type of the global configuration is used.

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

attachPageChange

Attaches event handler fnFunction to the pageChange event of this sap.ui.unified.calendar.MonthPicker.

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.calendar.MonthPicker itself.

If less than 12 months are displayed the pageChange event is fired if the displayed months are changed by user navigation.

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.calendar.MonthPicker itself

attachSelect

Attaches event handler fnFunction to the select event of this sap.ui.unified.calendar.MonthPicker.

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.calendar.MonthPicker 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.calendar.MonthPicker itself

destroySelectedDates

Destroys all the selectedDates in the aggregation selectedDates.

detachPageChange

Detaches event handler fnFunction from the pageChange event of this sap.ui.unified.calendar.MonthPicker.

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

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

sap.ui.unified.calendar.MonthPicker.extend

Creates a new subclass of class sap.ui.unified.calendar.MonthPicker 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

firePageChange

Fires event pageChange 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

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getColumns

Gets current value of property columns.

number of months in each row The value must be between 0 and 12 (0 means just to have all months in one row, independent of the number)

Default value is 3.

getIntervalSelection

Gets current value of property intervalSelection.

If set, interval selection is allowed

Default value is false.

sap.ui.unified.calendar.MonthPicker.getMetadata

Returns a metadata object for class sap.ui.unified.calendar.MonthPicker.

getMonth

Gets current value of property month.

The month is initial focused and selected The value must be between 0 and 11

Default value is 0.

getMonths

Gets current value of property months.

number of displayed months The value must be between 1 and 12

Default value is 12.

getPrimaryCalendarType

Gets current value of property primaryCalendarType.

If set, the calendar type is used for display. If not set, the calendar type of the global configuration is used.

getSelectedDates

Gets content of aggregation selectedDates.

Date Ranges for selected dates of the MonthPicker

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

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

nextPage

displays the next page

previousPage

displays the previous page

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.

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

setColumns

Sets a new value for property columns.

number of months in each row The value must be between 0 and 12 (0 means just to have all months in one row, independent of the number)

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 3.

Param Type DefaultValue Description
iColumns int 3

New value for property columns

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

setMinMax

sets a minimum and maximum month

Param Type DefaultValue Description
iMin int

minimum month as integer (starting with 0)

iMax int

maximum month as integer (starting with 0)

setMonth

Sets a new value for property month.

The month is initial focused and selected The value must be between 0 and 11

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 0.

Param Type DefaultValue Description
iMonth int 0

New value for property month

setMonths

Sets a new value for property months.

number of displayed months The value must be between 1 and 12

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

setPrimaryCalendarType

Sets a new value for property primaryCalendarType.

If set, the calendar type is used for display. If not set, the calendar type of the global configuration is used.

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sPrimaryCalendarType sap.ui.core.CalendarType

New value for property primaryCalendarType