class sap.m.DynamicDate

Control sample: sap.m.DynamicDate
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/m/DynamicDate
Application Component: CA-UI5-CTR

This class represents the dynamic date range type. Model values should be in the following format: { operator: "KEY", values: [param1, param2] }. Where the supported parameters are timestamps, month indexes and numbers (all three are numbers). Their type is defined by the corresponding DynamicDateOption instance identified by the same "KEY". This class is capable of formatting only the value parameters expected by the DynamicDateRange control. A display format may be provided via the format options.


Constructor

Constructor for a dynamic date range type.

new sap.m.DynamicDate(oFormatOptions?, oConstraints?)
Param Type Default Value Description
oFormatOptions? object

Format options. There are format options for each of the supported types of value parameters.

date? object

Display format options for the values that contain dates. For a list of all available options, see DateFormat.

month? object

Display format options for the values that contain month names. The only supported option is the pattern using the respective symbols for displaying months "MM", "MMM" or "MMMM".

int? object

Display format options for the values that contain numbers. For a list of all available options, see NumberFormat.

oConstraints? object

Value constraints

minimum? int

Smallest resulting date allowed for this type. Must be provided as a timestamps.

maximum? int

Greatest resulting date allowed for this type. Must be provided as a timestamps.


Methods Overview

Method Description
sap.m.DynamicDate.extend

Creates a new subclass of class sap.m.DynamicDate 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.model.SimpleType.extend.

formatValue

Formats the given object value to a similar object. The whole value is in the following format { operator: "KEY", values: [...array with dates or numbers to be formatted]}. Only formats the 'values' part of the given object. The dates are expected as 'timestamp' numbers and are converted to Javascript Date objects. The numbers and strings are left untouched.

sap.m.DynamicDate.getMetadata

Returns a metadata object for class sap.m.DynamicDate.

parseValue

Parses the given object value to a similar object. The whole value is in the following format { operator: "KEY", values: [...array with JS dates or numbers to be parsed]}. Only parses the 'values' part of the given object. The dates are expected as Javascript Dates and are converted to timestamps. The numbers and strings are left untouched. Special values with operator: "PARSEERROR" generate a parse exception.

sap.m.DynamicDate.extend

Creates a new subclass of class sap.m.DynamicDate 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.model.SimpleType.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

formatValue

Formats the given object value to a similar object. The whole value is in the following format { operator: "KEY", values: [...array with dates or numbers to be formatted]}. Only formats the 'values' part of the given object. The dates are expected as 'timestamp' numbers and are converted to Javascript Date objects. The numbers and strings are left untouched.

Param Type DefaultValue Description
oValue object

The value to be formatted

sap.m.DynamicDate.getMetadata

Returns a metadata object for class sap.m.DynamicDate.

parseValue

Parses the given object value to a similar object. The whole value is in the following format { operator: "KEY", values: [...array with JS dates or numbers to be parsed]}. Only parses the 'values' part of the given object. The dates are expected as Javascript Dates and are converted to timestamps. The numbers and strings are left untouched. Special values with operator: "PARSEERROR" generate a parse exception.

Param Type DefaultValue Description
oValue object

The value to be parsed