Class sap.ui.unified.calendar.YearPickerModule: sap/ui/unified/calendar/YearPicker

extends Control

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


Since: 1.28.0.
Constructor Summary
new sap.ui.unified.calendar.YearPicker(sId?, mSettings?)Constructor for a new YearPicker.
Event Summary
pageChange(oControlEvent)The pageChange event is fired if the displayed years are changed by user navigation.
select(oControlEvent)Month selection changed
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.unified.calendar.YearPicker.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.unified.calendar.YearPicker with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.unified.calendar.YearPicker.getMetadata()Returns a metadata object for class sap.ui.unified.calendar.YearPicker.
attachPageChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the pageChange event of this sap.ui.unified.calendar.YearPicker.
attachSelect(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the select event of this sap.ui.unified.calendar.YearPicker.
detachPageChange(fnFunction, oListener)Detaches event handler fnFunction from the pageChange event of this sap.ui.unified.calendar.YearPicker.
detachSelect(fnFunction, oListener)Detaches event handler fnFunction from the select event of this sap.ui.unified.calendar.YearPicker.
firePageChange(mArguments?)Fires event pageChange to attached listeners.
fireSelect(mArguments?)Fires event select to attached listeners.
getColumns()Gets current value of property columns.
getDate()Gets current value of property date.
getFirstRenderedDate()return the first date of the first rendered year Note: If the YearPicker is not rendered no date is returned
getPrimaryCalendarType()Gets current value of property primaryCalendarType.
getYears()Gets current value of property years.
nextPage()displays the next page
previousPage()displays the previous page
setColumns(iColumns)Sets a new value for property columns.
setDate(oDate)Sets a new value for property date.
setPrimaryCalendarType(sPrimaryCalendarType)Sets a new value for property primaryCalendarType.
setYears(iYears)Sets a new value for property years.
getYear()Gets current value of property year.
setYear(iYear)Sets a new value for property year.
Constructor Detail
new sap.ui.unified.calendar.YearPicker(sId?, mSettings?)
Constructor for a new YearPicker.

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:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Event Detail
pageChange(oControlEvent)
The pageChange event is fired if the displayed years are changed by user navigation.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Since:
1.38.0
select(oControlEvent)
Month selection changed
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.ui.unified.calendar.YearPicker.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.unified.calendar.YearPicker 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:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.unified.calendar.YearPicker.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.unified.calendar.YearPicker.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachPageChange(oData?, fnFunction, oListener?): sap.ui.unified.calendar.YearPicker
Attaches event handler fnFunction to the pageChange event of this sap.ui.unified.calendar.YearPicker.

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

The pageChange event is fired if the displayed years are changed by user navigation.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.unified.calendar.YearPicker itself
Since:
1.38.0
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining
attachSelect(oData?, fnFunction, oListener?): sap.ui.unified.calendar.YearPicker
Attaches event handler fnFunction to the select event of this sap.ui.unified.calendar.YearPicker.

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

Month selection changed

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.unified.calendar.YearPicker itself
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining
detachPageChange(fnFunction, oListener): sap.ui.unified.calendar.YearPicker
Detaches event handler fnFunction from the pageChange event of this sap.ui.unified.calendar.YearPicker.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Since:
1.38.0
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining
detachSelect(fnFunction, oListener): sap.ui.unified.calendar.YearPicker
Detaches event handler fnFunction from the select event of this sap.ui.unified.calendar.YearPicker.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining
firePageChange(mArguments?): sap.ui.unified.calendar.YearPicker
Fires event pageChange to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Since:
1.38.0
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining
fireSelect(mArguments?): sap.ui.unified.calendar.YearPicker
Fires event select to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining
getColumns(): int
Gets current value of property columns.

number of years in each row 0 means just to have all years in one row, independent of the number

Default value is 4.

Since:
1.30.0
Returns:
{int} Value of property columns
getDate(): object
Gets current value of property date.

Date as JavaScript Date object. For this date a YearPicker is rendered. If a Year is selected the date is updated with the start date of the selected year (depending on the calendar type).

Since:
1.34.0
Returns:
{object} Value of property date
getFirstRenderedDate(): object
return the first date of the first rendered year Note: If the YearPicker is not rendered no date is returned
Since:
1.38.0
Returns:
{object} JavaScript Date Object
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.

Since:
1.34.0
Returns:
{sap.ui.core.CalendarType} Value of property primaryCalendarType
getYears(): int
Gets current value of property years.

number of displayed years

Default value is 20.

Since:
1.30.0
Returns:
{int} Value of property years
displays the next page
Returns:
{sap.ui.unified.calendar.YearPicker}this to allow method chaining
displays the previous page
Returns:
{sap.ui.unified.calendar.YearPicker}this to allow method chaining
setColumns(iColumns): sap.ui.unified.calendar.YearPicker
Sets a new value for property columns.

number of years in each row 0 means just to have all years 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 4.

Parameters:
{int}iColumns New value for property columns
Since:
1.30.0
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining
Sets a new value for property date.

Date as JavaScript Date object. For this date a YearPicker is rendered. If a Year is selected the date is updated with the start date of the selected year (depending on the calendar type).

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

Parameters:
{object}oDate New value for property date
Since:
1.34.0
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining
setPrimaryCalendarType(sPrimaryCalendarType): sap.ui.unified.calendar.YearPicker
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.CalendarType}sPrimaryCalendarType New value for property primaryCalendarType
Since:
1.34.0
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining
Sets a new value for property years.

number of displayed years

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

Default value is 20.

Parameters:
{int}iYears New value for property years
Since:
1.30.0
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining
getYear(): int
Gets current value of property year.

The year is initial focused and selected The value must be between 0 and 9999

Default value is 2000.

Deprecated:
Since version 1.34.0 Use date instead
Returns:
{int} Value of property year
Sets a new value for property year.

The year is initial focused and selected The value must be between 0 and 9999

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

Default value is 2000.

Parameters:
{int}iYear New value for property year
Deprecated:
Since version 1.34.0 Use date instead
Returns:
{sap.ui.unified.calendar.YearPicker} Reference to this in order to allow method chaining