Class sap.ui.model.odata.type.TimeModule: sap/ui/model/odata/type/Time

extends ODataType

This class represents the OData V2 primitive type Edm.Time.

In ODataModel this type is represented as an object with two properties:

  • __edmType with the value "Edm.Time"
  • ms with the number of milliseconds since midnight


Since: 1.27.0.
Constructor Summary
new sap.ui.model.odata.type.Time(oFormatOptions?, oConstraints?)Constructor for an OData primitive type Edm.Time.
Method Summary
sap.ui.model.odata.type.Time.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.model.odata.type.Time with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.model.odata.type.Time.getMetadata()Returns a metadata object for class sap.ui.model.odata.type.Time.
formatValue(oValue, sTargetType)Formats the given value to the given target type
getName()Returns the type's name.
parseValue(sValue, sSourceType)Parses the given value, which is expected to be of the given type, to a time object.
validateValue(oValue)Validates whether the given value in model representation is valid and meets the defined constraints.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.model.odata.type.Time(oFormatOptions?, oConstraints?)
Constructor for an OData primitive type Edm.Time.
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
Method Detail
sap.ui.model.odata.type.Time.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.model.odata.type.Time 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.

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.Time.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.model.odata.type.Time.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
formatValue(oValue, sTargetType): string
Formats the given value to the given target type
Parameters:
{object}oValue the value in model representation to be formatted.
{string}oValue.__edmType the type has to be "Edm.Time"
{number}oValue.ms the time in milliseconds
{string}sTargetType the target type; may be "any" or "string". See sap.ui.model.odata.type for more information.
Exceptions:
{sap.ui.model.FormatException} if sTargetType is unsupported
Returns:
{string} the formatted output value in the target type; undefined or null are formatted to null
getName(): string
Returns the type's name.
Returns:
{string} the type's name
parseValue(sValue, sSourceType): object
Parses the given value, which is expected to be of the given type, to a time object.
Parameters:
{string}sValue the value to be parsed, maps "" to null
{string}sSourceType the source type (the expected type of sValue); must be "string". See sap.ui.model.odata.type for more information.
Exceptions:
{sap.ui.model.ParseException} if sSourceType is unsupported
Returns:
{object} the parsed value as described in formatValue
validateValue(oValue): void
Validates whether the given value in model representation is valid and meets the defined constraints.
Parameters:
{object}oValue the value to be validated
Exceptions:
{sap.ui.model.ValidateException} if the value is not valid