Class sap.m.DateTimeInputModule: sap/m/DateTimeInput

extends Control

Allows end users to interact with date and/or time and select from a date and/or time pad.

Note: This control should not be used any longer, instead please use the dedicated sap.m.DatePicker, sap.m.TimePicker or sap.m.DateTimePicker control.

Deprecated API:Since version 1.32.8. Instead, use the dedicated sap.m.DatePicker, sap.m.TimePicker or sap.m.DateTimePicker controls.


Since: 1.9.1.
Constructor Summary
new sap.m.DateTimeInput(sId?, mSettings?)Constructor for a new DateTimeInput.
Event Summary
change(oControlEvent)This event gets fired when the selection has finished and the value has changed.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.DateTimeInput.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.DateTimeInput with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.DateTimeInput.getMetadata()Returns a metadata object for class sap.m.DateTimeInput.
addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy.
attachChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the change event of this sap.m.DateTimeInput.
bindValue(oBindingInfo)Binds property value to model data.
detachChange(fnFunction, oListener)Detaches event handler fnFunction from the change event of this sap.m.DateTimeInput.
fireChange(mArguments?)Fires event change to attached listeners.
getAriaLabelledBy()Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
getDateValue()Gets current value of property dateValue.
getDisplayFormat()Gets current value of property displayFormat.
getEditable()Gets current value of property editable.
getEnabled()Gets current value of property enabled.
getName()Gets current value of property name.
getPlaceholder()Gets current value of property placeholder.
getShowValueStateMessage()Gets current value of property showValueStateMessage.
getTextAlign()Gets current value of property textAlign.
getTextDirection()Gets current value of property textDirection.
getType()Gets current value of property type.
getValue()Gets current value of property value.
getValueFormat()Gets current value of property valueFormat.
getValueState()Gets current value of property valueState.
getValueStateText()Gets current value of property valueStateText.
getWidth()Gets current value of property width.
removeAllAriaLabelledBy()Removes all the controls in the association named ariaLabelledBy.
removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy.
setDateValue(oDateValue)Sets a new value for property dateValue.
setDisplayFormat(sDisplayFormat)Sets a new value for property displayFormat.
setEditable(bEditable)Sets a new value for property editable.
setEnabled(bEnabled)Sets a new value for property enabled.
setName(sName)Sets a new value for property name.
setPlaceholder(sPlaceholder)Sets a new value for property placeholder.
setShowValueStateMessage(bShowValueStateMessage)Sets a new value for property showValueStateMessage.
setTextAlign(sTextAlign)Sets a new value for property textAlign.
setTextDirection(sTextDirection)Sets a new value for property textDirection.
setType(sType)Sets a new value for property type.
setValue(sValue)Sets a new value for property value.
setValueFormat(sValueFormat)Sets a new value for property valueFormat.
setValueState(sValueState)Sets a new value for property valueState.
setValueStateText(sValueStateText)Sets a new value for property valueStateText.
setWidth(sWidth)Sets a new value for property width.
unbindValue()Unbinds property value from model data.
Constructor Detail
new sap.m.DateTimeInput(sId?, mSettings?)
Constructor for a new DateTimeInput.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
{string}sId? ID for the new control, generated automatically if no ID is given
{object}mSettings? Initial settings for the new control
Deprecated:
Since version 1.32.8. Instead, use the dedicated sap.m.DatePicker, sap.m.TimePicker or sap.m.DateTimePicker controls.
Event Detail
change(oControlEvent)
This event gets fired when the selection has finished and the value has changed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.value The string value of the control in given valueFormat (or locale format).
{object}oControlEvent.getParameters.dateValue The value of control as JavaScript Date Object or null if value is empty.
{boolean}oControlEvent.getParameters.valid if set, the entered value is a valid date. If not set the entered value cannot be converted to a date.
Method Detail
sap.m.DateTimeInput.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.DateTimeInput 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.core.Control.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.m.DateTimeInput.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.DateTimeInput.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addAriaLabelledBy(vAriaLabelledBy): sap.m.DateTimeInput
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
{string|sap.ui.core.Control}vAriaLabelledBy the ariaLabelledBy to add; if empty, nothing is inserted
Since:
1.27.0
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
attachChange(oData?, fnFunction, oListener?): sap.m.DateTimeInput
Attaches event handler fnFunction to the change event of this sap.m.DateTimeInput.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.m.DateTimeInput itself.

This event gets fired when the selection has finished and the value has changed.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.m.DateTimeInput itself
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
bindValue(oBindingInfo): sap.m.DateTimeInput
Binds property value to model data.

See ManagedObject.bindProperty for a detailed description of the possible properties of oBindingInfo

Parameters:
{object}oBindingInfo The binding information
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
detachChange(fnFunction, oListener): sap.m.DateTimeInput
Detaches event handler fnFunction from the change event of this sap.m.DateTimeInput.

The passed function and listener object must match the ones used for event registration.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
fireChange(mArguments?): sap.m.DateTimeInput
Fires event change to attached listeners.

Expects the following event parameters:

  • value of type stringThe string value of the control in given valueFormat (or locale format).
  • dateValue of type objectThe value of control as JavaScript Date Object or null if value is empty.
  • valid of type booleanif set, the entered value is a valid date. If not set the entered value cannot be converted to a date.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
getAccessibilityInfo()
See:
{sap.ui.core.Control#getAccessibilityInfo}
getAriaLabelledBy(): sap.ui.core.Control[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Since:
1.27.0
Returns:
{sap.ui.core.Control[]}
getDateValue(): object
Gets current value of property dateValue.

This property as JavaScript Date Object can be used to assign a new value which is independent from valueFormat.

Returns:
{object} Value of property dateValue
getDisplayFormat(): string
Gets current value of property displayFormat.

Displays date value in this given format in text field. Default value is taken from locale settings. If you use data-binding on value property with type sap.ui.model.type.Date then you can ignore this property or the latter wins. If the user's browser supports native picker then this property is overwritten by browser with locale settings.

Returns:
{string} Value of property displayFormat
getEditable(): boolean
Gets current value of property editable.

Defines whether the control can be modified by the user or not. Note: A user can tab to non-editable control, highlight it, and copy the text from it.

Default value is true.

Since:
1.12.0
Returns:
{boolean} Value of property editable
getEnabled(): boolean
Gets current value of property enabled.

Indicates whether the user can interact with the control or not. Note: Disabled controls cannot be focused and they are out of the tab-chain.

Default value is true.

Returns:
{boolean} Value of property enabled
getName(): string
Gets current value of property name.

Defines the name of the control for the purposes of form submission.

Returns:
{string} Value of property name
getPlaceholder(): string
Gets current value of property placeholder.

Defines a short hint intended to aid the user with data entry when the control has no value.

Returns:
{string} Value of property placeholder
getShowValueStateMessage(): boolean
Gets current value of property showValueStateMessage.

Indicates whether the value state message should be shown or not.

Default value is true.

Since:
1.26.0
Returns:
{boolean} Value of property showValueStateMessage
getTextAlign(): sap.ui.core.TextAlign
Gets current value of property textAlign.

Defines the horizontal alignment of the text that is shown inside the input field.

Default value is Initial.

Since:
1.26.0
Returns:
{sap.ui.core.TextAlign} Value of property textAlign
getTextDirection(): sap.ui.core.TextDirection
Gets current value of property textDirection.

Defines the text directionality of the input field, e.g. RTL, LTR

Default value is Inherit.

Since:
1.28.0
Returns:
{sap.ui.core.TextDirection} Value of property textDirection
Gets current value of property type.

Type of DateTimeInput (e.g. Date, Time, DateTime)

Default value is Date.

Returns:
{sap.m.DateTimeInputType} Value of property type
getValue(): string
Gets current value of property value.

Defines the value of the control.

The new value must be in the format set by valueFormat.

The "Now" literal can also be assigned as a parameter to show the current date and/or time.

Returns:
{string} Value of property value
getValueFormat(): string
Gets current value of property valueFormat.

Given value property should match with valueFormat to parse date. Default value is taken from locale settings. You can only set and get value in this format. If you use data-binding on value property with type sap.ui.model.type.Date you can ignore this property or the latter wins.

Returns:
{string} Value of property valueFormat
getValueState(): sap.ui.core.ValueState
Gets current value of property valueState.

Visualizes the validation state of the control, e.g. Error, Warning, Success.

Default value is None.

Returns:
{sap.ui.core.ValueState} Value of property valueState
getValueStateText(): string
Gets current value of property valueStateText.

Defines the text that appears in the value state message pop-up. If this is not specified, a default text is shown from the resource bundle.

Since:
1.26.0
Returns:
{string} Value of property valueStateText
getWidth(): sap.ui.core.CSSSize
Gets current value of property width.

Defines the width of the control.

Default value is 100%.

Returns:
{sap.ui.core.CSSSize} Value of property width
removeAllAriaLabelledBy(): sap.ui.core.Control[]
Removes all the controls in the association named ariaLabelledBy.
Since:
1.27.0
Returns:
{sap.ui.core.Control[]} An array of the removed elements (might be empty)
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.Control
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
{int|string|sap.ui.core.Control}vAriaLabelledBy The ariaLabelledByto be removed or its index or ID
Since:
1.27.0
Returns:
{sap.ui.core.Control} the removed ariaLabelledBy or null
setDateValue(oDateValue): sap.m.DateTimeInput
Sets a new value for property dateValue.

This property as JavaScript Date Object can be used to assign a new value which is independent from valueFormat.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{object}oDateValue New value for property dateValue
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setDisplayFormat(sDisplayFormat): sap.m.DateTimeInput
Sets a new value for property displayFormat.

Displays date value in this given format in text field. Default value is taken from locale settings. If you use data-binding on value property with type sap.ui.model.type.Date then you can ignore this property or the latter wins. If the user's browser supports native picker then this property is overwritten by browser with locale settings.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{string}sDisplayFormat New value for property displayFormat
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setEditable(bEditable): sap.m.DateTimeInput
Sets a new value for property editable.

Defines whether the control can be modified by the user or not. Note: A user can tab to non-editable control, highlight it, and copy the text from it.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bEditable New value for property editable
Since:
1.12.0
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setEnabled(bEnabled): sap.m.DateTimeInput
Sets a new value for property enabled.

Indicates whether the user can interact with the control or not. Note: Disabled controls cannot be focused and they are out of the tab-chain.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bEnabled New value for property enabled
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setName(sName): sap.m.DateTimeInput
Sets a new value for property name.

Defines the name of the control for the purposes of form submission.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{string}sName New value for property name
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setPlaceholder(sPlaceholder): sap.m.DateTimeInput
Sets a new value for property placeholder.

Defines a short hint intended to aid the user with data entry when the control has no value.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{string}sPlaceholder New value for property placeholder
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setShowValueStateMessage(bShowValueStateMessage): sap.m.DateTimeInput
Sets a new value for property showValueStateMessage.

Indicates whether the value state message should be shown or not.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bShowValueStateMessage New value for property showValueStateMessage
Since:
1.26.0
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setTextAlign(sTextAlign): sap.m.DateTimeInput
Sets a new value for property textAlign.

Defines the horizontal alignment of the text that is shown inside the input field.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Initial.

Parameters:
{sap.ui.core.TextAlign}sTextAlign New value for property textAlign
Since:
1.26.0
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setTextDirection(sTextDirection): sap.m.DateTimeInput
Sets a new value for property textDirection.

Defines the text directionality of the input field, e.g. RTL, LTR

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Inherit.

Parameters:
{sap.ui.core.TextDirection}sTextDirection New value for property textDirection
Since:
1.28.0
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setType(sType): sap.m.DateTimeInput
Sets a new value for property type.

Type of DateTimeInput (e.g. Date, Time, DateTime)

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Date.

Parameters:
{sap.m.DateTimeInputType}sType New value for property type
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setValue(sValue): sap.m.DateTimeInput
Sets a new value for property value.

Defines the value of the control.

The new value must be in the format set by valueFormat.

The "Now" literal can also be assigned as a parameter to show the current date and/or time.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{string}sValue New value for property value
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setValueFormat(sValueFormat): sap.m.DateTimeInput
Sets a new value for property valueFormat.

Given value property should match with valueFormat to parse date. Default value is taken from locale settings. You can only set and get value in this format. If you use data-binding on value property with type sap.ui.model.type.Date you can ignore this property or the latter wins.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{string}sValueFormat New value for property valueFormat
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setValueState(sValueState): sap.m.DateTimeInput
Sets a new value for property valueState.

Visualizes the validation state of the control, e.g. Error, Warning, Success.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is None.

Parameters:
{sap.ui.core.ValueState}sValueState New value for property valueState
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setValueStateText(sValueStateText): sap.m.DateTimeInput
Sets a new value for property valueStateText.

Defines the text that appears in the value state message pop-up. If this is not specified, a default text is shown from the resource bundle.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{string}sValueStateText New value for property valueStateText
Since:
1.26.0
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
setWidth(sWidth): sap.m.DateTimeInput
Sets a new value for property width.

Defines the width of the control.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 100%.

Parameters:
{sap.ui.core.CSSSize}sWidth New value for property width
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining
unbindValue(): sap.m.DateTimeInput
Unbinds property value from model data.
Returns:
{sap.m.DateTimeInput} Reference to this in order to allow method chaining