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(mParameters?)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:
stringsId?ID for the new control, generated automatically if no ID is given
objectmSettings?Initial settings for the new control
Event Detail
change(oControlEvent)
This event gets fired when the selection has finished and the value has changed.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
stringoControlEvent.getParameters.valueThe string value of the control in given valueFormat (or locale format).
objectoControlEvent.getParameters.dateValueThe value of control as JavaScript Date Object or null if value is empty.
booleanoControlEvent.getParameters.validif 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:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.m.DateTimeInput.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.DateTimeInput.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addAriaLabelledBy(vAriaLabelledBy): sap.m.DateTimeInput
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledBythe ariaLabelledBy to add; if empty, nothing is inserted
Returns:
sap.m.DateTimeInputReference to this in order to allow method chaining
Since:
1.27.0
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:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.DateTimeInput itself
Returns:
sap.m.DateTimeInputReference 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:
objectoBindingInfoThe binding information
Returns:
sap.m.DateTimeInputReference 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:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.DateTimeInputReference to this in order to allow method chaining
fireChange(mParameters?): sap.m.DateTimeInput
Fires event change to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
stringmParameters.value?The string value of the control in given valueFormat (or locale format).
objectmParameters.dateValue?The value of control as JavaScript Date Object or null if value is empty.
booleanmParameters.valid?if set, the entered value is a valid date. If not set the entered value cannot be converted to a date.
Returns:
sap.m.DateTimeInputReference to this in order to allow method chaining
getAccessibilityInfo(): Object
Returns:
ObjectCurrent accessibility state of the control
See:
sap.ui.core.Control#getAccessibilityInfo
getAriaLabelledBy(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns:
sap.ui.core.ID[]
Since:
1.27.0
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:
objectValue 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:
stringValue 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.

Returns:
booleanValue of property editable
Since:
1.12.0
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:
booleanValue of property enabled
getName(): string

Gets current value of property name.

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

Returns:
stringValue 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:
stringValue 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.

Returns:
booleanValue of property showValueStateMessage
Since:
1.26.0
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.

Returns:
sap.ui.core.TextAlignValue of property textAlign
Since:
1.26.0
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.

Returns:
sap.ui.core.TextDirectionValue of property textDirection
Since:
1.28.0

Gets current value of property type.

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

Default value is Date.

Returns:
sap.m.DateTimeInputTypeValue 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:
stringValue 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:
stringValue 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.ValueStateValue 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.

Returns:
stringValue of property valueStateText
Since:
1.26.0
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.CSSSizeValue of property width
removeAllAriaLabelledBy(): sap.ui.core.ID[]
Removes all the controls in the association named ariaLabelledBy.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
Since:
1.27.0
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.ID
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
int|sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledByThe ariaLabelledBy to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed ariaLabelledBy or null
Since:
1.27.0
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:
objectoDateValueNew value for property dateValue
Returns:
sap.m.DateTimeInputReference 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:
stringsDisplayFormatNew value for property displayFormat
Returns:
sap.m.DateTimeInputReference 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:
booleanbEditableNew value for property editable
Returns:
sap.m.DateTimeInputReference to this in order to allow method chaining
Since:
1.12.0
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:
booleanbEnabledNew value for property enabled
Returns:
sap.m.DateTimeInputReference 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:
stringsNameNew value for property name
Returns:
sap.m.DateTimeInputReference 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:
stringsPlaceholderNew value for property placeholder
Returns:
sap.m.DateTimeInputReference 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:
booleanbShowValueStateMessageNew value for property showValueStateMessage
Returns:
sap.m.DateTimeInputReference to this in order to allow method chaining
Since:
1.26.0
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.TextAlignsTextAlignNew value for property textAlign
Returns:
sap.m.DateTimeInputReference to this in order to allow method chaining
Since:
1.26.0
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.TextDirectionsTextDirectionNew value for property textDirection
Returns:
sap.m.DateTimeInputReference to this in order to allow method chaining
Since:
1.28.0
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.DateTimeInputTypesTypeNew value for property type
Returns:
sap.m.DateTimeInputReference 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:
stringsValueNew value for property value
Returns:
sap.m.DateTimeInputReference 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:
stringsValueFormatNew value for property valueFormat
Returns:
sap.m.DateTimeInputReference 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.ValueStatesValueStateNew value for property valueState
Returns:
sap.m.DateTimeInputReference 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:
stringsValueStateTextNew value for property valueStateText
Returns:
sap.m.DateTimeInputReference to this in order to allow method chaining
Since:
1.26.0
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.CSSSizesWidthNew value for property width
Returns:
sap.m.DateTimeInputReference to this in order to allow method chaining
unbindValue(): sap.m.DateTimeInput
Unbinds property value from model data.
Returns:
sap.m.DateTimeInputReference to this in order to allow method chaining