This is an abstract base class for the OData primitive types Edm.DateTime
and Edm.DateTimeOffset
.
Base constructor for the primitive types Edm.DateTime
and Edm.DateTimeOffset
.
new sap.ui.model.odata.type.DateTimeBase(oFormatOptions?, oConstraints?)
Param | Type | Default Value | Description |
---|---|---|---|
oFormatOptions? | object | Type-specific format options; see subtypes |
|
oConstraints? | object | Constraints; validateValue throws an error if any constraint is violated |
|
isDateOnly? | boolean | false | If |
nullable? | boolean string | true | If |
precision? | boolean | 0 | The number of decimal places allowed in the seconds portion of a valid string value (OData V4 only); only integer values between 0 and 12 are valid (since 1.37.0) |
Method | Description |
---|---|
sap.ui.model.odata.type.DateTimeBase.extend |
Creates a new subclass of class sap.ui.model.odata.type.DateTimeBase with name
|
formatValue |
Formats the given value to the given target type. |
sap.ui.model.odata.type.DateTimeBase.getMetadata |
Returns a metadata object for class sap.ui.model.odata.type.DateTimeBase. |
parseValue |
Parses the given value to a |
validateValue |
Validates whether the given value in model representation is valid and meets the defined constraints. |
Creates a new subclass of class sap.ui.model.odata.type.DateTimeBase 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 |
---|---|---|---|
oValue | Date |
The value to be formatted, which is represented in the model as a |
|
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.DateTimeBase.
Parses the given value to a Date
instance (OData V2).
Param | Type | DefaultValue | Description |
---|---|---|---|
vValue | string Date |
The value to be parsed; the empty string and |
|
sSourceType | string |
The source type (the expected type of |
Validates whether the given value in model representation is valid and meets the defined constraints.
Param | Type | DefaultValue | Description |
---|---|---|---|
oValue | Date |
The value to be validated |