class sap.ui.unified.CalendarTimeInterval

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

Calendar with granularity of time items displayed in one line.


Constructor

Constructor for a new CalendarTimeInterval.

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.CalendarTimeInterval(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
_currentPicker string timesRow

Holds a reference to the currently shown picker. Possible values: timesRow, datesRow, monthPicker and yearPicker.

Since: 1.84.0.

Visibility: hidden
intervalMinutes int 60

Size of on time interval in minutes, default is 60 minutes.

Note: the start of the interval calculation is always on the corresponding date at 00:00.

An interval longer than 720 minutes is not allowed. Please use the CalendarDateInterval instead.

A day must be divisible by this interval size. One interval must not include more than one day.

Visibility: public
intervalSelection boolean false

If set, interval selection is allowed

Visibility: public
items int 12

Number of time items displayed. Default is 12.

Note: On phones, the maximum number of items displayed in the row is always 6.

Visibility: public
maxDate object

Maximum date that can be shown and selected in the Calendar. This must be a JavaScript date object.

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.

Visibility: public
minDate object

Minimum date that can be shown and selected in the Calendar. This must be a JavaScript date object.

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.

Visibility: public
pickerPopup boolean false

If set, the day-, month- and yearPicker opens on a popup

Since: 1.34.0.

Visibility: public
singleSelection boolean true

If set, only a single date or interval, if intervalSelection is enabled, can be selected

Note: Selection of multiple intervals is not supported in the current version.

Visibility: public
startDate object

Start date of the Interval as JavaScript Date object. The time interval corresponding to this Date and items and intervalMinutes will be the first time in the displayed row.

Visibility: public
width sap.ui.core.CSSSize

Width of the CalendarTimeInterval. The width of the single months depends on this width.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
datesRow 0..1 sap.ui.unified.calendar.Month
header 0..1 sap.ui.unified.calendar.Header

Hidden, for internal use only.

monthPicker 0..1 sap.ui.unified.calendar.MonthPicker
selectedDates 0..n sap.ui.unified.DateRange

Date ranges for selected items of the CalendarTimeInterval.

If singleSelection is set, only the first entry is used.

specialDates 0..n sap.ui.unified.DateTypeRange

Date ranges with type to visualize special items in the CalendarTimeInterval. If one interval is assigned to more than one type, only the first one will be used.

timesRow 0..1 sap.ui.unified.calendar.TimesRow
yearPicker 0..1 sap.ui.unified.calendar.YearPicker

Associations

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

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

legend 0..1 sap.ui.unified.CalendarLegend

Association to the CalendarLegend explaining the colors of the specialDates.

Note The legend does not have to be rendered but must exist, and all required types must be assigned.

Since: 1.38.5.


Events Overview

Event Description
cancel

Time selection was cancelled

select

Time selection changed

startDateChange

startDate was changed while navigation in CalendarTimeInterval

Since: 1.34.0.

cancel

Time selection was cancelled

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

select

Time selection changed

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

startDateChange

startDate was changed while navigation in CalendarTimeInterval

Since: 1.34.0.

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.

addSpecialDate

Adds some specialDate to the aggregation specialDates.

attachCancel

Attaches event handler fnFunction to the cancel event of this sap.ui.unified.CalendarTimeInterval.

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

Time selection was cancelled

attachSelect

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

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

Time selection changed

attachStartDateChange

Attaches event handler fnFunction to the startDateChange event of this sap.ui.unified.CalendarTimeInterval.

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

startDate was changed while navigation in CalendarTimeInterval

destroySelectedDates

Destroys all the selectedDates in the aggregation selectedDates.

destroySpecialDates

Destroys all the specialDates in the aggregation specialDates.

detachCancel

Detaches event handler fnFunction from the cancel event of this sap.ui.unified.CalendarTimeInterval.

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.CalendarTimeInterval.

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

detachStartDateChange

Detaches event handler fnFunction from the startDateChange event of this sap.ui.unified.CalendarTimeInterval.

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

displayDate

Displays an item in the CalendarTimeInterval but doesn't set the focus.

sap.ui.unified.CalendarTimeInterval.extend

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

fireCancel

Fires event cancel to attached listeners.

fireSelect

Fires event select to attached listeners.

fireStartDateChange

Fires event startDateChange to attached listeners.

focusDate

Sets the focused item of the CalendarTimeInterval.

getAriaLabelledBy

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

getIntervalMinutes

Gets current value of property intervalMinutes.

Size of on time interval in minutes, default is 60 minutes.

Note: the start of the interval calculation is always on the corresponding date at 00:00.

An interval longer than 720 minutes is not allowed. Please use the CalendarDateInterval instead.

A day must be divisible by this interval size. One interval must not include more than one day.

Default value is 60.

getIntervalSelection

Gets current value of property intervalSelection.

If set, interval selection is allowed

Default value is false.

getItems

Gets current value of property items.

Number of time items displayed. Default is 12.

Note: On phones, the maximum number of items displayed in the row is always 6.

Default value is 12.

getLegend

ID of the element which is the current target of the association legend, or null.

getMaxDate

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 maxDate is set to be before the minDate, the minDate is set to the begin of the month of the maxDate.

sap.ui.unified.CalendarTimeInterval.getMetadata

Returns a metadata object for class sap.ui.unified.CalendarTimeInterval.

getMinDate

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 minDate is set to be after the maxDate, the maxDate is set to the end of the month of the minDate.

getPickerPopup

Gets current value of property pickerPopup.

If set, the day-, month- and yearPicker opens on a popup

Default value is false.

getSelectedDates

Gets content of aggregation selectedDates.

Date ranges for selected items of the CalendarTimeInterval.

If singleSelection is set, only the first entry is used.

getSingleSelection

Gets current value of property singleSelection.

If set, only a single date or interval, if intervalSelection is enabled, can be selected

Note: Selection of multiple intervals is not supported in the current version.

Default value is true.

getSpecialDates

Gets content of aggregation specialDates.

Date ranges with type to visualize special items in the CalendarTimeInterval. If one interval is assigned to more than one type, only the first one will be used.

getStartDate

Gets current value of property startDate.

Start date of the Interval as JavaScript Date object. The time interval corresponding to this Date and items and intervalMinutes will be the first time in the displayed row.

getWidth

Gets current value of property width.

Width of the CalendarTimeInterval. The width of the single months depends on this width.

indexOfSelectedDate

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

indexOfSpecialDate

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

insertSelectedDate

Inserts a selectedDate into the aggregation selectedDates.

insertSpecialDate

Inserts a specialDate into the aggregation specialDates.

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.

removeAllSpecialDates

Removes all the controls from the aggregation specialDates.

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.

removeSpecialDate

Removes a specialDate from the aggregation specialDates.

setIntervalMinutes

Sets a new value for property intervalMinutes.

Size of on time interval in minutes, default is 60 minutes.

Note: the start of the interval calculation is always on the corresponding date at 00:00.

An interval longer than 720 minutes is not allowed. Please use the CalendarDateInterval instead.

A day must be divisible by this interval size. One interval must not include more than one day.

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

Default value is 60.

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.

setItems

Sets a new value for property items.

Number of time items displayed. Default is 12.

Note: On phones, the maximum number of items displayed in the row is always 6.

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

Default value is 12.

setLegend

Sets the associated legend.

setMaxDate

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

setMinDate

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

setPickerPopup

Sets a new value for property pickerPopup.

If set, the day-, month- and yearPicker opens on a popup

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

Default value is false.

setSingleSelection

Sets a new value for property singleSelection.

If set, only a single date or interval, if intervalSelection is enabled, can be selected

Note: Selection of multiple intervals is not supported in the current version.

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

Default value is true.

setStartDate

Sets a new value for property startDate.

Start date of the Interval as JavaScript Date object. The time interval corresponding to this Date and items and intervalMinutes will be the first time in the displayed row.

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

setWidth

Sets a new value for property width.

Width of the CalendarTimeInterval. The width of the single months depends on this width.

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

addSpecialDate

Adds some specialDate to the aggregation specialDates.

Param Type DefaultValue Description
oSpecialDate sap.ui.unified.DateTypeRange

The specialDate to add; if empty, nothing is inserted

attachCancel

Attaches event handler fnFunction to the cancel event of this sap.ui.unified.CalendarTimeInterval.

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

Time selection was cancelled

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

attachSelect

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

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

Time 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.CalendarTimeInterval itself

attachStartDateChange

Attaches event handler fnFunction to the startDateChange event of this sap.ui.unified.CalendarTimeInterval.

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

startDate was changed while navigation in CalendarTimeInterval

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

destroySelectedDates

Destroys all the selectedDates in the aggregation selectedDates.

destroySpecialDates

Destroys all the specialDates in the aggregation specialDates.

detachCancel

Detaches event handler fnFunction from the cancel event of this sap.ui.unified.CalendarTimeInterval.

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.CalendarTimeInterval.

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

detachStartDateChange

Detaches event handler fnFunction from the startDateChange event of this sap.ui.unified.CalendarTimeInterval.

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

displayDate

Displays an item in the CalendarTimeInterval but doesn't set the focus.

Param Type DefaultValue Description
oDate object

JavaScript date object for displayed item.

sap.ui.unified.CalendarTimeInterval.extend

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

fireCancel

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

fireStartDateChange

Fires event startDateChange to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

focusDate

Sets the focused item of the CalendarTimeInterval.

Param Type DefaultValue Description
oDate object

JavaScript date object for focused item.

getAriaLabelledBy

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

getIntervalMinutes

Gets current value of property intervalMinutes.

Size of on time interval in minutes, default is 60 minutes.

Note: the start of the interval calculation is always on the corresponding date at 00:00.

An interval longer than 720 minutes is not allowed. Please use the CalendarDateInterval instead.

A day must be divisible by this interval size. One interval must not include more than one day.

Default value is 60.

getIntervalSelection

Gets current value of property intervalSelection.

If set, interval selection is allowed

Default value is false.

getItems

Gets current value of property items.

Number of time items displayed. Default is 12.

Note: On phones, the maximum number of items displayed in the row is always 6.

Default value is 12.

getLegend

ID of the element which is the current target of the association legend, or null.

getMaxDate

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 maxDate is set to be before the minDate, the minDate is set to the begin of the month of the maxDate.

sap.ui.unified.CalendarTimeInterval.getMetadata

Returns a metadata object for class sap.ui.unified.CalendarTimeInterval.

getMinDate

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 minDate is set to be after the maxDate, the maxDate is set to the end of the month of the minDate.

getPickerPopup

Gets current value of property pickerPopup.

If set, the day-, month- and yearPicker opens on a popup

Default value is false.

getSelectedDates

Gets content of aggregation selectedDates.

Date ranges for selected items of the CalendarTimeInterval.

If singleSelection is set, only the first entry is used.

getSingleSelection

Gets current value of property singleSelection.

If set, only a single date or interval, if intervalSelection is enabled, can be selected

Note: Selection of multiple intervals is not supported in the current version.

Default value is true.

getSpecialDates

Gets content of aggregation specialDates.

Date ranges with type to visualize special items in the CalendarTimeInterval. If one interval is assigned to more than one type, only the first one will be used.

getStartDate

Gets current value of property startDate.

Start date of the Interval as JavaScript Date object. The time interval corresponding to this Date and items and intervalMinutes will be the first time in the displayed row.

getWidth

Gets current value of property width.

Width of the CalendarTimeInterval. The width of the single months depends on this width.

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

indexOfSpecialDate

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

Param Type DefaultValue Description
oSpecialDate sap.ui.unified.DateTypeRange

The specialDate 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

insertSpecialDate

Inserts a specialDate into the aggregation specialDates.

Param Type DefaultValue Description
oSpecialDate sap.ui.unified.DateTypeRange

The specialDate to insert; if empty, nothing is inserted

iIndex int

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

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.

removeAllSpecialDates

Removes all the controls from the aggregation specialDates.

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

removeSpecialDate

Removes a specialDate from the aggregation specialDates.

Param Type DefaultValue Description
vSpecialDate int string sap.ui.unified.DateTypeRange

The specialDate to remove or its index or id

setIntervalMinutes

Sets a new value for property intervalMinutes.

Size of on time interval in minutes, default is 60 minutes.

Note: the start of the interval calculation is always on the corresponding date at 00:00.

An interval longer than 720 minutes is not allowed. Please use the CalendarDateInterval instead.

A day must be divisible by this interval size. One interval must not include more than one day.

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

Default value is 60.

Param Type DefaultValue Description
iIntervalMinutes int 60

New value for property intervalMinutes

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

setItems

Sets a new value for property items.

Number of time items displayed. Default is 12.

Note: On phones, the maximum number of items displayed in the row is always 6.

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
iItems int 12

New value for property items

setLegend

Sets the associated legend.

Param Type DefaultValue Description
oLegend sap.ui.core.ID sap.ui.unified.CalendarLegend

ID of an element which becomes the new target of this legend association; alternatively, an element instance may be given

setMaxDate

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

Param Type DefaultValue Description
oMaxDate object

New value for property maxDate

setMinDate

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

Param Type DefaultValue Description
oMinDate object

New value for property minDate

setPickerPopup

Sets a new value for property pickerPopup.

If set, the day-, month- and yearPicker opens on a popup

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
bPickerPopup boolean false

New value for property pickerPopup

setSingleSelection

Sets a new value for property singleSelection.

If set, only a single date or interval, if intervalSelection is enabled, can be selected

Note: Selection of multiple intervals is not supported in the current version.

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

Default value is true.

Param Type DefaultValue Description
bSingleSelection boolean true

New value for property singleSelection

setStartDate

Sets a new value for property startDate.

Start date of the Interval as JavaScript Date object. The time interval corresponding to this Date and items and intervalMinutes will be the first time in the displayed row.

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

Param Type DefaultValue Description
oStartDate object

New value for property startDate

setWidth

Sets a new value for property width.

Width of the CalendarTimeInterval. The width of the single months depends on this width.

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

Param Type DefaultValue Description
sWidth sap.ui.core.CSSSize

New value for property width