Class sap.ui.unified.calendar.MonthPickerModule: sap/ui/unified/calendar/MonthPicker

extends Control

renders a MonthPicker with ItemNavigation This is used inside the calendar. Not for stand alone usage
Since: 1.28.0.
Constructor Summary
new sap.ui.unified.calendar.MonthPicker(sId?, mSettings?)Constructor for a new MonthPicker.
Event Summary
pageChange(oControlEvent)If less than 12 months are displayed the pageChange event is fired if the displayed months are changed by user navigation.
select(oControlEvent)Month selection changed
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.unified.calendar.MonthPicker.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.unified.calendar.MonthPicker with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.unified.calendar.MonthPicker.getMetadata()Returns a metadata object for class sap.ui.unified.calendar.MonthPicker.
attachPageChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the pageChange event of this sap.ui.unified.calendar.MonthPicker.
attachSelect(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the select event of this sap.ui.unified.calendar.MonthPicker.
detachPageChange(fnFunction, oListener)Detaches event handler fnFunction from the pageChange event of this sap.ui.unified.calendar.MonthPicker.
detachSelect(fnFunction, oListener)Detaches event handler fnFunction from the select event of this sap.ui.unified.calendar.MonthPicker.
firePageChange(mParameters?)Fires event pageChange to attached listeners.
fireSelect(mParameters?)Fires event select to attached listeners.
getColumns()Gets current value of property columns.
getMonth()Gets current value of property month.
getMonths()Gets current value of property months.
getPrimaryCalendarType()Gets current value of property primaryCalendarType.
nextPage()displays the next page
previousPage()displays the previous page
setColumns(iColumns)Sets a new value for property columns.
setMinMax(iMin?, iMax?)sets a minimum and maximum month
setMonth(iMonth)Sets a new value for property month.
setMonths(iMonths)Sets a new value for property months.
setPrimaryCalendarType(sPrimaryCalendarType)Sets a new value for property primaryCalendarType.
Constructor Detail
new sap.ui.unified.calendar.MonthPicker(sId?, mSettings?)

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

The supported settings are:

  • Properties

  • Events

    • select : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • pageChange : 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
pageChange(oControlEvent)
If less than 12 months are displayed the pageChange event is fired if the displayed months are changed by user navigation.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
Since:
1.38.0
select(oControlEvent)
Month selection changed
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
Method Detail
sap.ui.unified.calendar.MonthPicker.extend(sClassName, oClassInfo?, FNMetaImpl?): function

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.

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.calendar.MonthPicker.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.unified.calendar.MonthPicker.
Returns:
sap.ui.base.MetadataMetadata object describing this class
attachPageChange(oData?, fnFunction, oListener?): sap.ui.unified.calendar.MonthPicker

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.

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.calendar.MonthPicker itself
Returns:
sap.ui.unified.calendar.MonthPickerReference to this in order to allow method chaining
Since:
1.38.0
attachSelect(oData?, fnFunction, oListener?): sap.ui.unified.calendar.MonthPicker

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

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.calendar.MonthPicker itself
Returns:
sap.ui.unified.calendar.MonthPickerReference to this in order to allow method chaining
detachPageChange(fnFunction, oListener): sap.ui.unified.calendar.MonthPicker

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.

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.calendar.MonthPickerReference to this in order to allow method chaining
Since:
1.38.0
detachSelect(fnFunction, oListener): sap.ui.unified.calendar.MonthPicker

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.

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.calendar.MonthPickerReference to this in order to allow method chaining
firePageChange(mParameters?): sap.ui.unified.calendar.MonthPicker
Fires event pageChange to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.ui.unified.calendar.MonthPickerReference to this in order to allow method chaining
Since:
1.38.0
fireSelect(mParameters?): sap.ui.unified.calendar.MonthPicker
Fires event select to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.ui.unified.calendar.MonthPickerReference to this in order to allow method chaining
getColumns(): int

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.

Returns:
intValue of property columns
Since:
1.30.0
getMonth(): int

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.

Returns:
intValue of property month
getMonths(): int

Gets current value of property months.

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

Default value is 12.

Returns:
intValue of property months
Since:
1.30.0
getPrimaryCalendarType(): sap.ui.core.CalendarType

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.

Returns:
sap.ui.core.CalendarTypeValue of property primaryCalendarType
Since:
1.34.0
displays the next page
Returns:
sap.ui.unified.calendar.MonthPickerthis to allow method chaining
displays the previous page
Returns:
sap.ui.unified.calendar.MonthPickerthis to allow method chaining

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.

Parameters:
intiColumnsNew value for property columns
Returns:
sap.ui.unified.calendar.MonthPickerReference to this in order to allow method chaining
Since:
1.30.0
setMinMax(iMin?, iMax?): sap.ui.unified.calendar.MonthPicker
sets a minimum and maximum month
Parameters:
intiMin?minimum month as integer (starting with 0)
intiMax?maximum month as integer (starting with 0)
Returns:
sap.ui.unified.calendar.MonthPickerthis to allow method chaining

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.

Parameters:
intiMonthNew value for property month
Returns:
sap.ui.unified.calendar.MonthPickerReference to this in order to allow method chaining

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.

Parameters:
intiMonthsNew value for property months
Returns:
sap.ui.unified.calendar.MonthPickerReference to this in order to allow method chaining
Since:
1.30.0
setPrimaryCalendarType(sPrimaryCalendarType): sap.ui.unified.calendar.MonthPicker

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.

Parameters:
sap.ui.core.CalendarTypesPrimaryCalendarTypeNew value for property primaryCalendarType
Returns:
sap.ui.unified.calendar.MonthPickerReference to this in order to allow method chaining
Since:
1.34.0