Class sap.suite.ui.commons.DateRangeScrollerModule: sap/suite/ui/commons/DateRangeScroller

extends Control

The DateRangeScroller provides a method to scroll through a series of time periods, each of which is represented by a starting date and an ending date, known as the date range. The user may scroll to the previous or next date range. Several predefined ranges are supported such as day, week, work week, month, and year.

Deprecated API:Since version 1.34. Deprecated. Not Fiori.

Constructor Summary
new sap.suite.ui.commons.DateRangeScroller(sId?, mSettings?)Constructor for a new DateRangeScroller.
Event Summary
change(oControlEvent)This event is fired whenever the date range is changed.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.suite.ui.commons.DateRangeScroller.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.suite.ui.commons.DateRangeScroller with name sClassName and enriches it with the information contained in oClassInfo.
sap.suite.ui.commons.DateRangeScroller.getMetadata()Returns a metadata object for class sap.suite.ui.commons.DateRangeScroller.
addAriaDescribedBy(vAriaDescribedBy)
addAriaLabelledBy(vAriaLabelledBy)
attachChange(oData?, fnFunction, oListener?)Attach event handler fnFunction to the 'change' event of this sap.suite.ui.commons.DateRangeScroller.
decrementDateRange()Decrement the date range by a time period increment according to the the date range type and fire the dateChange event.
detachChange(fnFunction, oListener)Detach event handler fnFunction from the 'change' event of this sap.suite.ui.commons.DateRangeScroller.
fireChange(mArguments?)Fire event change to attached listeners.
getAriaDescribedBy()Association to controls / ids which describe this control (see WAI-ARIA attribute aria-describedby).
getAriaLabelledBy()Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledby).
getDateRange()Returns an object containing startDate and endDate set to the current start and end Date objects.
incrementDateRange()Increment the date range by a time period increment according to the the date range type and fire the dateChange event.
removeAriaDescribedBy(vAriaDescribedBy)
removeAriaLabelledBy(vAriaLabelledBy)
setDateFormat(oDateFormat)Setter for dateFormat which is used for formating the dates If passed object is null or is of incorrect type, control's default formatting will be used.
setDateRangeCustom(dInitialDate, [iDuration=current custom duration])Set a custom date range beginning with the specified start date that increments/decrements iDuration days at a time.
setDateRangeDay(dInitialDate)Set a date range equal to a single day, starting with the given initial date.
setDateRangeMonth(dInitialDate)Set a date range that increments/decrements one calendar month at a time.
setDateRangeWeek(dInitialDate, oSettings?)Set a date range that steps one week at a time.
setDateRangeYear(dInitialDate)Set a date range that increments/decrements one calendar year at a time.
Constructor Detail
new sap.suite.ui.commons.DateRangeScroller(sId?, mSettings?)
Constructor for a new DateRangeScroller.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers.

If the name of a setting is ambiguous (e.g. a property has the same name as an event), then the framework assumes property, aggregation, association, event in that order. To override this automatic resolution, one of the prefixes "aggregation:", "association:" or "event:" can be added to the name of the setting (such a prefixed name must be enclosed in single or double quotes).

The supported settings are:

  • Properties
    • Aggregations
      • Associations
      • Events
        • change : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
      Parameters:
      {string}sId? id for the new control, generated automatically if no id is given
      {object}mSettings? initial settings for the new control
      Deprecated:
      Since version 1.34. Deprecated. Not Fiori.
      Event Detail
      change(oControlEvent)
      This event is fired whenever the date range is changed.
      Parameters:
      {sap.ui.base.Event}oControlEvent
      {sap.ui.base.EventProvider}oControlEvent.getSource
      {object}oControlEvent.getParameters
      {any}oControlEvent.getParameters.dateRange Object containing startDate and endDate Date properties signifying the start and ending dates of the currently selected range.
      Method Detail
      sap.suite.ui.commons.DateRangeScroller.extend(sClassName, oClassInfo?, FNMetaImpl?): function
      Creates a new subclass of class sap.suite.ui.commons.DateRangeScroller with name sClassName and enriches it with the information contained in oClassInfo.

      oClassInfo might contain the same kind of informations as described in Element.extend.

      Parameters:
      {string}sClassName name of the class to be created
      {object}oClassInfo? object literal with informations about the class
      {function}FNMetaImpl? constructor function for the metadata object. If not given, it defaults to sap.ui.core.ElementMetadata.
      Returns:
      {function} the created class / constructor function
      sap.suite.ui.commons.DateRangeScroller.getMetadata(): sap.ui.base.Metadata
      Returns a metadata object for class sap.suite.ui.commons.DateRangeScroller.
      Returns:
      {sap.ui.base.Metadata} Metadata object describing this class
      addAriaDescribedBy(vAriaDescribedBy): sap.suite.ui.commons.DateRangeScroller
      Parameters:
      {string|sap.ui.core.Control}vAriaDescribedBy Id of a ariaDescribedBy which becomes an additional target of this ariaDescribedBy association. Alternatively, a ariaDescribedBy instance may be given.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining
      addAriaLabelledBy(vAriaLabelledBy): sap.suite.ui.commons.DateRangeScroller
      Parameters:
      {string|sap.ui.core.Control}vAriaLabelledBy Id of a ariaLabelledBy which becomes an additional target of this ariaLabelledBy association. Alternatively, a ariaLabelledBy instance may be given.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining
      attachChange(oData?, fnFunction, oListener?): sap.suite.ui.commons.DateRangeScroller
      Attach event handler fnFunction to the 'change' event of this sap.suite.ui.commons.DateRangeScroller.
      . When called, the context of the event handler (its this) will be bound to oListener if specified otherwise to this sap.suite.ui.commons.DateRangeScroller.
      itself.

      This event is fired whenever the date range is 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 call, when the event occurs.
      {object}oListener? Context object to call the event handler with. Defaults to this sap.suite.ui.commons.DateRangeScroller.
      itself.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining
      Decrement the date range by a time period increment according to the the date range type and fire the dateChange event.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining
      detachChange(fnFunction, oListener): sap.suite.ui.commons.DateRangeScroller
      Detach event handler fnFunction from the 'change' event of this sap.suite.ui.commons.DateRangeScroller.

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

      Parameters:
      {function}fnFunction The function to call, when the event occurs.
      {object}oListener Context object on which the given function had to be called.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining
      fireChange(mArguments?): sap.suite.ui.commons.DateRangeScroller
      Fire event change to attached listeners.

      Expects following event parameters:

      • 'dateRange' of type any Object containing startDate and endDate Date properties signifying the start and ending dates of the currently selected range.
      Parameters:
      {Map}mArguments? the arguments to pass along with the event.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining
      getAriaDescribedBy(): string[]
      Association to controls / ids which describe this control (see WAI-ARIA attribute aria-describedby).
      Returns:
      {string[]}
      getAriaLabelledBy(): string[]
      Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledby).
      Returns:
      {string[]}
      getDateRange()
      Returns an object containing startDate and endDate set to the current start and end Date objects.
      Increment the date range by a time period increment according to the the date range type and fire the dateChange event.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining.
      removeAllAriaDescribedBy(): string[]
      Returns:
      {string[]} an array with the ids of the removed elements (might be empty)
      removeAllAriaLabelledBy(): string[]
      Returns:
      {string[]} an array with the ids of the removed elements (might be empty)
      removeAriaDescribedBy(vAriaDescribedBy): string
      Parameters:
      {int|string|sap.ui.core.Control}vAriaDescribedBy the ariaDescribedBy to remove or its index or id
      Returns:
      {string} the id of the removed ariaDescribedBy or null
      removeAriaLabelledBy(vAriaLabelledBy): string
      Parameters:
      {int|string|sap.ui.core.Control}vAriaLabelledBy the ariaLabelledBy to remove or its index or id
      Returns:
      {string} the id of the removed ariaLabelledBy or null
      setDateFormat(oDateFormat)
      Setter for dateFormat which is used for formating the dates If passed object is null or is of incorrect type, control's default formatting will be used.
      Parameters:
      {sap.ui.core.format.DateFormat}oDateFormat
      setDateRangeCustom(dInitialDate, [iDuration=current custom duration]): sap.suite.ui.commons.DateRangeScroller
      Set a custom date range beginning with the specified start date that increments/decrements iDuration days at a time.
      Parameters:
      dInitialDate The initial date for the custom range.
      [iDuration=current custom duration] The number of days in the custom range, including the start date.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining.
      setDateRangeDay(dInitialDate): sap.suite.ui.commons.DateRangeScroller
      Set a date range equal to a single day, starting with the given initial date.
      Parameters:
      {Date}dInitialDate The initial date.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining.
      setDateRangeMonth(dInitialDate): sap.suite.ui.commons.DateRangeScroller
      Set a date range that increments/decrements one calendar month at a time. The month date range begins on the first day of the month (beginning of the day) and ends on the last day of the month (end of the day).
      Parameters:
      {Date}dInitialDate Any date that falls within the desired month.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining.
      setDateRangeWeek(dInitialDate, oSettings?): sap.suite.ui.commons.DateRangeScroller
      Set a date range that steps one week at a time. The starting date is set according to the first day of the week (default is Monday) and the initial date. For example, if the first day of the week is set to Tuesday and the initial date is Wednesday, January 9, 2013, then the starting date will be Tuesday, January 8, 2013.

      The last day of the range is calculated by adding (duration - 1) days to the starting date.

      Parameters:
      {Date}dInitialDate Any date that falls on the desired week. Start/end dates will be adjusted according to the first day of the week.
      {Object}oSettings?
      oSettings.duration?, Default: 7 The number of days in the range with a minimum of 1 and maximum of 7.
      oSettings.iFirstDayOfWeek?, Default: 1 The starting day for the range. Valid values are 0-6, with 0=Sunday and 6=Saturday.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining.
      setDateRangeYear(dInitialDate): sap.suite.ui.commons.DateRangeScroller
      Set a date range that increments/decrements one calendar year at a time. The year date range begins on the first day of the year (beginning of the day) and ends on the last day of the year (end of the day).
      Parameters:
      {Date}dInitialDate Any date that falls within the desired year.
      Returns:
      {sap.suite.ui.commons.DateRangeScroller}this to allow method chaining.