This class represents the OData primitive type Edm.DateTimeOffset
.
In sap.ui.model.odata.v2.ODataModel this type is represented as a Date
instance in local time. In sap.ui.model.odata.v4.ODataModel this type is represented as a string
like "1970-12-31T23:59:58Z". See parameter oConstraints.V4
for more information.
Constructor for a primitive type Edm.DateTimeOffset
.
new sap.ui.model.odata.type.DateTimeOffset(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 |
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) |
V4? | boolean | false | Whether OData V4 semantics apply and the model representation is expected to be a |
Method | Description |
---|---|
sap.ui.model.odata.type.DateTimeOffset.extend |
Creates a new subclass of class sap.ui.model.odata.type.DateTimeOffset with name
|
formatValue |
Formats the given value to the given target type. |
sap.ui.model.odata.type.DateTimeOffset.getMetadata |
Returns a metadata object for class sap.ui.model.odata.type.DateTimeOffset. |
getName |
Returns the type's name. |
parseValue |
Parses the given value to a |
validateValue |
Validates whether the given value in model representation is valid and meets the defined constraints, depending on the model's OData version. |
Creates a new subclass of class sap.ui.model.odata.type.DateTimeOffset 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.DateTimeBase.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 | Date string |
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.DateTimeOffset.
Parses the given value to a Date
instance (OData V2) or a string like "1970-12-31T23:59:58Z" (OData V4), depending on the model's OData version.
Param | Type | DefaultValue | Description |
---|---|---|---|
vValue | Date string |
The value to be parsed; the empty string and |
|
sSourceType | string |
The source type (the expected type of |