renders a YearPicker with ItemNavigation This is used inside the calendar. Not for stand alone usage. As in all date-time controls, all pubic JS Date objects that are given (e.g. setDate()
) or read (e.g. getFirstRenderedDate
) with values which are considered as date objects in browser(local) timezone.
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#constructor for a general description of the syntax of the settings object.
new sap.ui.unified.calendar.YearPicker(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 |
Name | Type | Default Value | Description |
---|---|---|---|
_middleDate | object | Date as CalendarDate object. Holds the rendered date in the middle of the grid. |
|
columns | int | 4 | number of years in each row 0 means just to have all years in one row, independent of the number |
date | object | Date as JavaScript Date object. For this date a |
|
intervalSelection | boolean | false | If set, interval selection is allowed |
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. |
|
year | int | 2000 | The year is initial focused and selected The value must be between 0 and 9999 Visibility: public |
years | int | 20 | number of displayed years |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
selectedDates | 0..n | sap.ui.unified.DateRange |
Date Ranges for selected dates of the YearPicker |
Event | Description |
---|---|
pageChange |
The |
select |
Year selection changed |
Method | Description |
---|---|
addSelectedDate |
Adds some selectedDate to the aggregation selectedDates. |
attachPageChange |
Attaches event handler When called, the context of the event handler (its The |
attachSelect |
Attaches event handler When called, the context of the event handler (its Year selection changed |
destroySelectedDates |
Destroys all the selectedDates in the aggregation selectedDates. |
detachPageChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachSelect |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.unified.calendar.YearPicker.extend |
Creates a new subclass of class sap.ui.unified.calendar.YearPicker with name
|
firePageChange |
Fires event pageChange to attached listeners. |
fireSelect |
Fires event select to attached listeners. |
getColumns |
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 |
getDate |
Gets current value of property date. Date as JavaScript Date object. For this date a |
getFirstRenderedDate |
return the first date of the first rendered year Note: If the YearPicker is not rendered no date is returned |
getIntervalSelection |
Gets current value of property intervalSelection. If set, interval selection is allowed Default value is |
sap.ui.unified.calendar.YearPicker.getMetadata |
Returns a metadata object for class sap.ui.unified.calendar.YearPicker. |
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 YearPicker |
getYear |
Gets current value of property year. The year is initial focused and selected The value must be between 0 and 9999 Default value is
Since 1.34.0 replaced by <code>date</code> property
|
getYears |
Gets current value of property years. number of displayed years Default value is |
indexOfSelectedDate |
Checks for the provided |
insertSelectedDate |
Inserts a selectedDate into the aggregation selectedDates. |
nextPage |
displays the next page |
previousPage |
displays the previous page |
removeAllSelectedDates |
Removes all the controls from the aggregation selectedDates. Additionally, it unregisters them from the hosting UIArea. |
removeSelectedDate |
Removes a selectedDate from the aggregation selectedDates. |
setColumns |
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 Default value is |
setIntervalSelection |
Sets a new value for property intervalSelection. If set, interval selection is allowed When called with a value of Default value is |
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 |
setYear |
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 Default value is
Since 1.34.0 replaced by <code>date</code> property
|
setYears |
Sets a new value for property years. number of displayed years When called with a value of Default value is |
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 |
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.
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 |
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.
Year 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 |
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.
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 |
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.
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 |
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.
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 |
Fires event pageChange to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event select to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
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
.
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).
return the first date of the first rendered year Note: If the YearPicker is not rendered no date is returned
Gets current value of property intervalSelection.
If set, interval selection is allowed
Default value is false
.
Returns a metadata object for class sap.ui.unified.calendar.YearPicker.
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.
Gets content of aggregation selectedDates.
Date Ranges for selected dates of the YearPicker
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
.
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 |
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 |
Removes all the controls from the aggregation selectedDates.
Additionally, it unregisters them from the hosting UIArea.
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 |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
iColumns | int | 4 |
New value for property |
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 |
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 |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
iYear | int | 2000 |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
iYears | int | 20 |
New value for property |