sap.ui.unified.Calendar.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.unified.Calendar 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 |
Returns a metadata object for class sap.ui.unified.Calendar.
Returns:
Adds some ariaLabelledBy into the association ariaLabelledBy
.
Parameters:
{string|sap.ui.core.Control} | vAriaLabelledBy | the ariaLabelledBy to add; if empty, nothing is inserted |
- Since:
- 1.28.0
Returns:
Adds some disabledDate to the aggregation disabledDates
.
Parameters:
- Since:
- 1.38.0
Returns:
Adds some selectedDate to the aggregation selectedDates
.
Parameters:
Returns:
Adds some specialDate to the aggregation specialDates
.
Parameters:
- Since:
- 1.24.0
Returns:
Attaches event handler
fnFunction
to the
cancel
event of this
sap.ui.unified.Calendar
.
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
itself.
Date selection was cancelled
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 itself |
Returns:
Attaches event handler
fnFunction
to the
select
event of this
sap.ui.unified.Calendar
.
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
itself.
Date 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 itself |
Returns:
Attaches event handler
fnFunction
to the
startDateChange
event of this
sap.ui.unified.Calendar
.
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
itself.
startDate
was changed while navigation in Calendar
Use getStartDate
function to determine the current start date
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 itself |
- Since:
- 1.34.0
Returns:
Destroys all the disabledDates in the aggregation disabledDates
.
- Since:
- 1.38.0
Returns:
Destroys all the selectedDates in the aggregation selectedDates
.
Returns:
Destroys all the specialDates in the aggregation specialDates
.
- Since:
- 1.24.0
Returns:
Detaches event handler
fnFunction
from the
cancel
event of this
sap.ui.unified.Calendar
.
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:
Detaches event handler
fnFunction
from the
select
event of this
sap.ui.unified.Calendar
.
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:
Detaches event handler
fnFunction
from the
startDateChange
event of this
sap.ui.unified.Calendar
.
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.34.0
Returns:
Displays a date in the calendar but don't set the focus.
Parameters:
{object} | oDate | JavaScript date object for focused date. |
- Since:
- 1.28.0
Returns:
Fires event cancel
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Fires event select
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Fires event startDateChange
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
- Since:
- 1.34.0
Returns:
Sets the focused date of the calendar.
Parameters:
{object} | oDate | JavaScript date object for focused date. |
Returns:
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy
.
- Since:
- 1.28.0
Returns:
Gets content of aggregation
disabledDates
.
Date Ranges for disabled dates
- Since:
- 1.38.0
Returns:
getFirstDayOfWeek(): int
Gets current value of property
firstDayOfWeek
.
If set, the first day of the displayed week is this day. Valid values are 0 to 6. If not a valid value is set, the default of the used locale is used.
Default value is -1
.
- Since:
- 1.28.9
Returns:
{int} | Value of property firstDayOfWeek |
getIntervalSelection(): boolean
Gets current value of property
intervalSelection
.
If set, interval selection is allowed
Default value is false
.
Returns:
{boolean} | Value of property intervalSelection |
ID of the element which is the current target of the association legend
, or null
.
- Since:
- 1.38.5
Returns:
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 date is inside of a month the complete month is displayed, but dates outside the valid range can not be selected.
Note: If the maxDate
is set to be before the minDate
, the minDate
is set to the begin of the month of the maxDate
.
- Since:
- 1.38.0
Returns:
{object} | Value of property maxDate |
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 date is inside of a month the complete month is displayed, but dates outside the valid range can not be selected.
Note: If the minDate
is set to be after the maxDate
, the maxDate
is set to the end of the month of the minDate
.
- Since:
- 1.38.0
Returns:
{object} | Value of property minDate |
getMonths(): int
Gets current value of property
months
.
number of months displayed on phones always only one month is displayed
Default value is 1
.
- Since:
- 1.28.0
Returns:
{int} | Value of property months |
getNonWorkingDays(): int[]
Gets current value of property
nonWorkingDays
.
If set, the provided weekdays are displayed as non-working days. Valid values inside the array are 0 to 6. If not set, the weekend defined in the locale settings is displayed as non-working days.
- Since:
- 1.28.9
Returns:
{int[]} | Value of property nonWorkingDays |
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:
Gets current value of property
secondaryCalendarType
.
If set, the days are also displayed in this calendar type If not set, the dates are only displayed in the primary calendar type
- Since:
- 1.34.0
Returns:
Gets content of aggregation
selectedDates
.
Date Ranges for selected dates of the DatePicker
Returns:
getSingleSelection(): boolean
Gets current value of property
singleSelection
.
If set, only a single date or interval, if intervalSelection is enabled, can be selected
Default value is true
.
Returns:
{boolean} | Value of property singleSelection |
Gets content of aggregation
specialDates
.
Date Range with type to visualize special days in the Calendar. If one day is assigned to more than one Type, only the first one will be used.
- Since:
- 1.24.0
Returns:
getStartDate(): object
Returns the first day of the displayed month.
There might be some days of the previous month shown, but they can not be focused.
- Since:
- 1.34.1
Returns:
{object} | JavaScript date object for start date. |
Gets current value of property
width
.
Width of Calendar
Note: There is a theme depending minimum width, so the calendar can not be set smaller.
- Since:
- 1.38.0
Returns:
indexOfDisabledDate(oDisabledDate): int
Checks for the provided sap.ui.unified.DateRange
in the aggregation disabledDates
. and returns its index if found or -1 otherwise.
Parameters:
- Since:
- 1.38.0
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
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:
Returns:
{int} | The 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:
- Since:
- 1.24.0
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
Inserts a disabledDate into the aggregation disabledDates
.
Parameters:
{sap.ui.unified.DateRange} | oDisabledDate | the disabledDate to insert; if empty, nothing is inserted |
{int} | iIndex | the 0 -based index the disabledDate should be inserted at; for a negative value of iIndex , the disabledDate is inserted at position 0; for a value greater than the current size of the aggregation, the disabledDate is inserted at the last position |
- Since:
- 1.38.0
Returns:
Inserts a selectedDate into the aggregation selectedDates
.
Parameters:
{sap.ui.unified.DateRange} | oSelectedDate | the selectedDate to insert; if empty, nothing is inserted |
{int} | iIndex | 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 |
Returns:
Inserts a specialDate into the aggregation specialDates
.
Parameters:
{sap.ui.unified.DateTypeRange} | oSpecialDate | the specialDate to insert; if empty, nothing is inserted |
{int} | iIndex | the 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 |
- Since:
- 1.24.0
Returns:
Removes all the controls in the association named ariaLabelledBy
.
- Since:
- 1.28.0
Returns:
Removes all the controls from the aggregation
disabledDates
.
Additionally, it unregisters them from the hosting UIArea.
- Since:
- 1.38.0
Returns:
Removes all the controls from the aggregation
selectedDates
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
Removes all the controls from the aggregation
specialDates
.
Additionally, it unregisters them from the hosting UIArea.
- Since:
- 1.24.0
Returns:
Removes an ariaLabelledBy from the association named ariaLabelledBy
.
Parameters:
{int|string|sap.ui.core.Control} | vAriaLabelledBy | The ariaLabelledByto be removed or its index or ID |
- Since:
- 1.28.0
Returns:
Removes a disabledDate from the aggregation disabledDates
.
Parameters:
- Since:
- 1.38.0
Returns:
Removes a selectedDate from the aggregation selectedDates
.
Parameters:
Returns:
Removes a specialDate from the aggregation specialDates
.
Parameters:
- Since:
- 1.24.0
Returns:
Sets a new value for property
firstDayOfWeek
.
If set, the first day of the displayed week is this day. Valid values are 0 to 6. If not a valid value is set, the default of the used locale is used.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is -1
.
Parameters:
{int} | iFirstDayOfWeek | New value for property firstDayOfWeek |
- Since:
- 1.28.9
Returns:
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:
{boolean} | bIntervalSelection | New value for property intervalSelection |
Returns:
Sets the associated legend
.
Parameters:
{sap.ui.unified.CalendarLegend} | oLegend | Id of an element which becomes the new target of this legend association; alternatively, an element instance may be given |
- Since:
- 1.38.5
Returns:
Sets a new value for property
maxDate
.
Maximum date that can be shown and selected in the Calendar. This must be a JavaScript date object.
Note: if the date is inside of a month the complete month is displayed, but dates outside the valid range can not be selected.
Note: If the maxDate
is set to be before the minDate
, the minDate
is set to the begin of the month of the maxDate
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{object} | oMaxDate | New value for property maxDate |
- Since:
- 1.38.0
Returns:
Sets a new value for property
minDate
.
Minimum date that can be shown and selected in the Calendar. This must be a JavaScript date object.
Note: if the date is inside of a month the complete month is displayed, but dates outside the valid range can not be selected.
Note: If the minDate
is set to be after the maxDate
, the maxDate
is set to the end of the month of the minDate
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{object} | oMinDate | New value for property minDate |
- Since:
- 1.38.0
Returns:
Sets a new value for property
months
.
number of months displayed on phones always only one month is displayed
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 1
.
Parameters:
{int} | iMonths | New value for property months |
- Since:
- 1.28.0
Returns:
Sets a new value for property
nonWorkingDays
.
If set, the provided weekdays are displayed as non-working days. Valid values inside the array are 0 to 6. If not set, the weekend defined in the locale settings is displayed as non-working days.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
{int[]} | sNonWorkingDays | New value for property nonWorkingDays |
- Since:
- 1.28.9
Returns:
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:
- Since:
- 1.34.0
Returns:
Sets a new value for property
secondaryCalendarType
.
If set, the days are also displayed in this calendar type If not set, the dates are only displayed in the primary calendar type
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
- Since:
- 1.34.0
Returns:
Sets a new value for property
singleSelection
.
If set, only a single date or interval, if intervalSelection is enabled, can be selected
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bSingleSelection | New value for property singleSelection |
Returns:
Sets a new value for property
width
.
Width of Calendar
Note: There is a theme depending minimum width, so the calendar can not be set smaller.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
- Since:
- 1.38.0
Returns: