class sap.ui.unified.CalendarDateInterval

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

CalendarDateInterval only visualizes the dates in a one-line interval and allows the selection of a single day.


Constructor

Constructor for a new CalendarDateInterval.

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.CalendarDateInterval(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
days int 7

number of days displayed on phones the maximum rendered number of days is 8.

Visibility: public
pickerPopup boolean false

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

Since: 1.34.0.

Visibility: public
showDayNamesLine boolean true

If set the day names are shown in a separate line. If not set the day names are shown inside the single days.

Since: 1.34.0.

Visibility: public
startDate object

Start date of the Interval

Visibility: public

Borrowed Properties

Name Type Default Value Description
firstDayOfWeek int -1

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.

Since: 1.28.9.

Visibility: public
intervalSelection boolean false

If set, interval selection is allowed

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

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

Visibility: public
months int 1

Determines the number of months displayed.

As of version 1.50, the duplicated dates are not displayed if there are multiple months.

Note: On phones, only one month is displayed.

Since: 1.28.0.

Visibility: public
nonWorkingDays int[]

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.

Note: Keep in mind that this property sets only weekly-recurring days as non-working. If you need specific dates or dates ranges, such as national holidays, use the specialDates aggregation to set them. Both the non-working days (from property) and dates (from aggregation) are visualized the same.

Since: 1.28.9.

Visibility: public
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.

Since: 1.34.0.

Visibility: public
secondaryCalendarType sap.ui.core.CalendarType

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.

Visibility: public
showCurrentDateButton boolean false

Determines whether there is a shortcut navigation to Today. When used in Month, Year or Year-range picker view, the calendar navigates to Day picker view.

Since: 1.95.

Visibility: public
showWeekNumbers boolean true

Determines whether the week numbers in the months are displayed.

Note: For Islamic calendars, the week numbers are not displayed regardless of what is set to this property.

Since: 1.48.

Visibility: public
singleSelection boolean true

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

Visibility: public
width sap.ui.core.CSSSize

Width of Calendar

Note: There is a theme depending minimum width, so the calendar can not be set smaller.

Since: 1.38.0.

Visibility: public

Borrowed Aggregations

Name Cardinality Type Description
disabledDates 0..n sap.ui.unified.DateRange

Dates or date ranges for disabled dates.

To set a single date (instead of a range), set only the startDate property of the sap.ui.unified.DateRange class.

Since: 1.38.0.

selectedDates 0..n sap.ui.unified.DateRange

Dates or date ranges for selected dates.

To set a single date (instead of a range), set only the startDate property of the sap.ui.unified.DateRange class.

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

Dates or date ranges 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.

To set a single date (instead of a range), set only the startDate property of the sap.ui.unified.DateRange class.

Note: Keep in mind that the NonWorking type is for marking specific dates or date ranges as non-working, where if you need a weekly-reccuring non-working days (weekend), you should use the nonWorkingDays property. Both the non-working days (from property) and dates (from aggregation) are visualized the same.

Since: 1.24.0.


Methods Overview

Method Description
_getDaysLarge

If more than this number of days are displayed, start and end month are displayed on the button.

sap.ui.unified.CalendarDateInterval.extend

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

getDays

Gets current value of property days.

number of days displayed on phones the maximum rendered number of days is 8.

Default value is 7.

sap.ui.unified.CalendarDateInterval.getMetadata

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

getPickerPopup

Gets current value of property pickerPopup.

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

Default value is false.

getShowDayNamesLine

Gets current value of property showDayNamesLine.

If set the day names are shown in a separate line. If not set the day names are shown inside the single days.

Default value is true.

getStartDate

Gets current value of property startDate.

Start date of the Interval

setDays

Sets a new value for property days.

number of days displayed on phones the maximum rendered number of days is 8.

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

Default value is 7.

setFirstDayOfWeek

Setter for property firstDayOfWeek.

Property firstDayOfWeek is not supported in sap.ui.unified.CalendarDateInterval control.

setMonths

Setter for property months.

Property months is not supported in sap.ui.unified.CalendarDateInterval control.

setPickerPopup

Sets a new value for property pickerPopup.

If set, the 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.

setShowDayNamesLine

Sets a new value for property showDayNamesLine.

If set the day names are shown in a separate line. If not set the day names are shown inside the single days.

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

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

_getDaysLarge

If more than this number of days are displayed, start and end month are displayed on the button.

sap.ui.unified.CalendarDateInterval.extend

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

getDays

Gets current value of property days.

number of days displayed on phones the maximum rendered number of days is 8.

Default value is 7.

sap.ui.unified.CalendarDateInterval.getMetadata

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

getPickerPopup

Gets current value of property pickerPopup.

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

Default value is false.

getShowDayNamesLine

Gets current value of property showDayNamesLine.

If set the day names are shown in a separate line. If not set the day names are shown inside the single days.

Default value is true.

getStartDate

Gets current value of property startDate.

Start date of the Interval

setDays

Sets a new value for property days.

number of days displayed on phones the maximum rendered number of days is 8.

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

Default value is 7.

Param Type DefaultValue Description
iDays int 7

New value for property days

setFirstDayOfWeek

Setter for property firstDayOfWeek.

Property firstDayOfWeek is not supported in sap.ui.unified.CalendarDateInterval control.

Param Type DefaultValue Description
iFirstDayOfWeek int

First day of the week

setMonths

Setter for property months.

Property months is not supported in sap.ui.unified.CalendarDateInterval control.

Param Type DefaultValue Description
iMonths int

How many months to be displayed

setPickerPopup

Sets a new value for property pickerPopup.

If set, the 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

setShowDayNamesLine

Sets a new value for property showDayNamesLine.

If set the day names are shown in a separate line. If not set the day names are shown inside the single days.

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
bShowDayNamesLine boolean true

New value for property showDayNamesLine

setStartDate

Sets a new value for property startDate.

Start date of the Interval

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