This class represents the OData V2 primitive type Edm.DateTime
.
If you want to display a date and a time, prefer sap.ui.model.odata.type.DateTimeOffset, specifically designed for this purpose.
Use DateTime
with the SAP-specific annotation display-format=Date
(resp. the constraint displayFormat: "Date"
) to display only a date.
In sap.ui.model.odata.v2.ODataModel this type is represented as a Date
. With the constraint displayFormat: "Date"
, the time zone is UTC and the time part is ignored, otherwise it is a date/time value in local time.
Constructor for a primitive type Edm.DateTime
.
new sap.ui.model.odata.type.DateTime(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 |
displayFormat? | string | may be "Date", in this case only the date part is used, the time part is always 00:00:00 and the time zone is UTC to avoid time-zone-related problems |
Method | Description |
---|---|
sap.ui.model.odata.type.DateTime.extend |
Creates a new subclass of class sap.ui.model.odata.type.DateTime with name
|
sap.ui.model.odata.type.DateTime.getMetadata |
Returns a metadata object for class sap.ui.model.odata.type.DateTime. |
getName |
Returns the type's name. |
Creates a new subclass of class sap.ui.model.odata.type.DateTime 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 |