This class represents the OData V4 primitive type Edm.Date
.
In sap.ui.model.odata.v4.ODataModel this type is represented as a string
in the format "yyyy-MM-dd".
Note: For an OData V2 service use sap.ui.model.odata.type.DateTime with the constraint displayFormat: "Date"
to display only a date.
Documentation links:
Constructor for an OData primitive type Edm.Date
.
new sap.ui.model.odata.type.Date(oFormatOptions?, oConstraints?)
Param | Type | Default Value | Description |
---|---|---|---|
oFormatOptions? | object | format options as defined in sap.ui.core.format.DateFormat |
|
oConstraints? | object | constraints; validateValue throws an error if any constraint is violated |
|
nullable? | boolean string | true | if |
Method | Description |
---|---|
sap.ui.model.odata.type.Date.extend |
Creates a new subclass of class sap.ui.model.odata.type.Date with name
|
formatValue |
Formats the given value to the given target type. |
sap.ui.model.odata.type.Date.getMetadata |
Returns a metadata object for class sap.ui.model.odata.type.Date. |
getName |
Returns the type's name. |
parseValue |
Parses the given value to a date. |
validateValue |
Validates whether the given value in model representation is valid and meets the given constraints. |
Creates a new subclass of class sap.ui.model.odata.type.Date 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.odata.type.ODataType.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 |
Formats the given value to the given target type.
Param | Type | DefaultValue | Description |
---|---|---|---|
vValue | string Date |
the value to be formatted; |
|
sTargetType | string |
the target type; may be "any", "object" (since 1.69.0), "string", or a type with one of these types as its primitive type; see sap.ui.model.odata.type for more information. |
Returns a metadata object for class sap.ui.model.odata.type.Date.
Parses the given value to a date.
Param | Type | DefaultValue | Description |
---|---|---|---|
vValue | string Date |
the value to be parsed, maps |
|
sSourceType | string |
the source type (the expected type of |