Class sap.m.DateTimeInputModule: sap/m/DateTimeInput
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.
sClassName
and enriches it with the information contained in oClassInfo
.fnFunction
to the change
event of this sap.m.DateTimeInput
.fnFunction
from the change
event of this sap.m.DateTimeInput
.ariaLabelledBy
.ariaLabelledBy
.showValueStateMessage
. 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:
- Properties
- value : string
- width : sap.ui.core.CSSSize (default: 100%)
- enabled : boolean (default: true)
- editable : boolean (default: true)
- valueState : sap.ui.core.ValueState (default: None)
- valueStateText : string
- showValueStateMessage : boolean (default: true)
- name : string
- placeholder : string
- textAlign : sap.ui.core.TextAlign (default: Initial)
- textDirection : sap.ui.core.TextDirection (default: Inherit)
- type : sap.m.DateTimeInputType (default: Date)
- displayFormat : string
- valueFormat : string
- dateValue : object
- Aggregations
- Events
- change : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.
{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
orsap.m.DateTimePicker
controls.
{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. |
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.
{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 |
{function} | Created class / constructor function |
{sap.ui.base.Metadata} | Metadata object describing this class |
ariaLabelledBy
. {string|sap.ui.core.Control} | vAriaLabelledBy | the ariaLabelledBy to add; if empty, nothing is inserted |
- Since:
- 1.27.0
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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.
{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 |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
value
to model data. See ManagedObject.bindProperty for a detailed description of the possible properties of oBindingInfo
{object} | oBindingInfo | The binding information |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
fnFunction
from the change
event of this sap.m.DateTimeInput
. The passed function and listener object must match the ones used for event registration.
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
change
to attached listeners. Expects the following event parameters:
value
of typestring
The string value of the control in given valueFormat (or locale format).dateValue
of typeobject
The value of control as JavaScript Date Object or null if value is empty.valid
of typeboolean
if set, the entered value is a valid date. If not set the entered value cannot be converted to a date.
{Map} | mArguments? | The arguments to pass along with the event |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
ariaLabelledBy
. - Since:
- 1.27.0
{sap.ui.core.Control[]} |
dateValue
. This property as JavaScript Date Object can be used to assign a new value which is independent from valueFormat.
{object} | Value of property dateValue |
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.
{string} | Value of property displayFormat |
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
{boolean} | Value of property editable |
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
.
{boolean} | Value of property enabled |
name
. Defines the name of the control for the purposes of form submission.
{string} | Value of property name |
placeholder
. Defines a short hint intended to aid the user with data entry when the control has no value.
{string} | Value of property placeholder |
showValueStateMessage
. Indicates whether the value state message should be shown or not.
Default value is true
.
- Since:
- 1.26.0
{boolean} | Value of property showValueStateMessage |
textAlign
. Defines the horizontal alignment of the text that is shown inside the input field.
Default value is Initial
.
- Since:
- 1.26.0
{sap.ui.core.TextAlign} | Value of property textAlign |
textDirection
. Defines the text directionality of the input field, e.g. RTL
, LTR
Default value is Inherit
.
- Since:
- 1.28.0
{sap.ui.core.TextDirection} | Value of property textDirection |
type
. Type of DateTimeInput (e.g. Date, Time, DateTime)
Default value is Date
.
{sap.m.DateTimeInputType} | Value of property type |
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.
{string} | Value of property value |
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.
{string} | Value of property valueFormat |
valueState
. Visualizes the validation state of the control, e.g. Error
, Warning
, Success
.
Default value is None
.
{sap.ui.core.ValueState} | Value of property valueState |
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
{string} | Value of property valueStateText |
width
. Defines the width of the control.
Default value is 100%
.
{sap.ui.core.CSSSize} | Value of property width |
ariaLabelledBy
. - Since:
- 1.27.0
{sap.ui.core.Control[]} | An array of the removed elements (might be empty) |
ariaLabelledBy
. {int|string|sap.ui.core.Control} | vAriaLabelledBy | The ariaLabelledByto be removed or its index or ID |
- Since:
- 1.27.0
{sap.ui.core.Control} | the removed ariaLabelledBy or null |
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.
{object} | oDateValue | New value for property dateValue |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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.
{string} | sDisplayFormat | New value for property displayFormat |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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
.
{boolean} | bEditable | New value for property editable |
- Since:
- 1.12.0
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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
.
{boolean} | bEnabled | New value for property enabled |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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.
{string} | sName | New value for property name |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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.
{string} | sPlaceholder | New value for property placeholder |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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
.
{boolean} | bShowValueStateMessage | New value for property showValueStateMessage |
- Since:
- 1.26.0
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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
.
{sap.ui.core.TextAlign} | sTextAlign | New value for property textAlign |
- Since:
- 1.26.0
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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
.
{sap.ui.core.TextDirection} | sTextDirection | New value for property textDirection |
- Since:
- 1.28.0
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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
.
{sap.m.DateTimeInputType} | sType | New value for property type |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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.
{string} | sValue | New value for property value |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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.
{string} | sValueFormat | New value for property valueFormat |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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
.
{sap.ui.core.ValueState} | sValueState | New value for property valueState |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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.
{string} | sValueStateText | New value for property valueStateText |
- Since:
- 1.26.0
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
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%
.
{sap.ui.core.CSSSize} | sWidth | New value for property width |
{sap.m.DateTimeInput} | Reference to this in order to allow method chaining |
value
from model data. {sap.m.DateTimeInput} | Reference to this in order to allow method chaining |