Class sap.ui.model.odata.type.DateTimeModule: sap/ui/model/odata/type/DateTime
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 UTF and the time part is ignored, otherwise it is a date/time value in local time.
Since: 1.27.0.
Constructor Summary
new sap.ui.model.odata.type.DateTime(oFormatOptions?, oConstraints?)Constructor for a primitive type
Edm.DateTime
.Method Summary
sap.ui.model.odata.type.DateTime.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.model.odata.type.DateTime with name
sClassName
and enriches it with the information contained in oClassInfo
.sap.ui.model.odata.type.DateTime.getMetadata()Returns a metadata object for class sap.ui.model.odata.type.DateTime.
Methods borrowed from class sap.ui.model.odata.type.DateTimeBase
Methods borrowed from class sap.ui.model.odata.type.ODataType
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.model.odata.type.DateTime(oFormatOptions?, oConstraints?)
Constructor for a primitive type
Edm.DateTime
. Parameters:
{object} | oFormatOptions? | format options as defined in sap.ui.core.format.DateFormat |
{object} | oConstraints? | constraints; validateValue throws an error if any constraint is violated |
{boolean|string} | oConstraints.nullable?, Default: true | if true , the value null is accepted |
{string} | oConstraints.displayFormat? | 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 Detail
sap.ui.model.odata.type.DateTime.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
sap.ui.model.odata.type.DateTime.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.model.odata.type.DateTime.
Returns:
{sap.ui.base.Metadata} | Metadata object describing this class |