Allows end users to interact with date (between 0001-01-01 and 9999-12-31) 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.
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#constructor for a general description of the syntax of the settings object.
new sap.m.DateTimeInput(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new control, generated automatically if no ID is given |
|
mSettings? | object | Initial settings for the new control |
Name | Type | Default Value | Description |
---|---|---|---|
dateValue | object | This property as JavaScript Date Object can be used to assign a new value which is independent from valueFormat. Visibility: public |
|
displayFormat | string | 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. Visibility: public |
|
editable | boolean | true | 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. |
enabled | boolean | true | 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. Visibility: public |
name | string | Defines the name of the control for the purposes of form submission. Visibility: public |
|
placeholder | string | Defines a short hint intended to aid the user with data entry when the control has no value. Visibility: public |
|
showValueStateMessage | boolean | true | Indicates whether the value state message should be shown or not. |
textAlign | sap.ui.core.TextAlign | Initial | Defines the horizontal alignment of the text that is shown inside the input field. |
textDirection | sap.ui.core.TextDirection | Inherit | Defines the text directionality of the input field, e.g. |
type | sap.m.DateTimeInputType | Date | Type of DateTimeInput (e.g. Date, Time, DateTime) Visibility: public |
value | string | Defines the value of the control. The new value must be in the format set by The "Now" literal can also be assigned as a parameter to show the current date and/or time. Visibility: public |
|
valueFormat | string | 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. Visibility: public |
|
valueState | sap.ui.core.ValueState | None | Visualizes the validation state of the control, e.g. |
valueStateText | string | 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. |
|
width | sap.ui.core.CSSSize | 100% | Defines the width of the control. Visibility: public |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
_picker | 0..1 | sap.ui.core.Control |
Name | Cardinality | Type | Description |
---|---|---|---|
ariaLabelledBy | 0..n | sap.ui.core.Control |
Association to controls / IDs that label this control (see WAI-ARIA attribute aria-labelledby). |
Event | Description |
---|---|
change |
This event gets fired when the selection has finished and the value has changed. |
This event gets fired when the selection has finished and the value has changed.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
value | string |
The string value of the control in given valueFormat (or locale format). |
dateValue | object |
The value of control as JavaScript Date Object or null if value is empty. |
valid | boolean |
if set, the entered value is a valid date. If not set the entered value cannot be converted to a date. |
Method | Description |
---|---|
addAriaLabelledBy |
Adds some ariaLabelledBy into the association ariaLabelledBy. |
attachChange |
Attaches event handler When called, the context of the event handler (its This event gets fired when the selection has finished and the value has changed. |
bindValue |
Binds property value to model data. See ManagedObject.bindProperty for a detailed description of the possible properties of |
detachChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.m.DateTimeInput.extend |
Creates a new subclass of class sap.m.DateTimeInput with name
|
fireChange |
Fires event change to attached listeners. |
getAccessibilityInfo |
References:
|
getAriaLabelledBy |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy. |
getDateValue |
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. |
getDisplayFormat |
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. |
getEditable |
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 |
getEnabled |
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 |
sap.m.DateTimeInput.getMetadata |
Returns a metadata object for class sap.m.DateTimeInput. |
getName |
Gets current value of property name. Defines the name of the control for the purposes of form submission. |
getPlaceholder |
Gets current value of property placeholder. Defines a short hint intended to aid the user with data entry when the control has no value. |
getShowValueStateMessage |
Gets current value of property showValueStateMessage. Indicates whether the value state message should be shown or not. Default value is |
getTextAlign |
Gets current value of property textAlign. Defines the horizontal alignment of the text that is shown inside the input field. Default value is |
getTextDirection |
Gets current value of property textDirection. Defines the text directionality of the input field, e.g. Default value is |
getType |
Gets current value of property type. Type of DateTimeInput (e.g. Date, Time, DateTime) Default value is |
getValue |
Gets current value of property value. Defines the value of the control. The new value must be in the format set by The "Now" literal can also be assigned as a parameter to show the current date and/or time. |
getValueFormat |
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. |
getValueState |
Gets current value of property valueState. Visualizes the validation state of the control, e.g. Default value is |
getValueStateText |
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. |
getWidth |
Gets current value of property width. Defines the width of the control. Default value is |
removeAllAriaLabelledBy |
Removes all the controls in the association named ariaLabelledBy. |
removeAriaLabelledBy |
Removes an ariaLabelledBy from the association named ariaLabelledBy. |
setDateValue |
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 |
setDisplayFormat |
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 |
setEditable |
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 Default value is |
setEnabled |
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 Default value is |
setName |
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 |
setPlaceholder |
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 |
setShowValueStateMessage |
Sets a new value for property showValueStateMessage. Indicates whether the value state message should be shown or not. When called with a value of Default value is |
setTextAlign |
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 Default value is |
setTextDirection |
Sets a new value for property textDirection. Defines the text directionality of the input field, e.g. When called with a value of Default value is |
setType |
Sets a new value for property type. Type of DateTimeInput (e.g. Date, Time, DateTime) When called with a value of Default value is |
setValue |
Sets a new value for property value. Defines the value of the control. The new value must be in the format set by The "Now" literal can also be assigned as a parameter to show the current date and/or time. When called with a value of |
setValueFormat |
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 |
setValueState |
Sets a new value for property valueState. Visualizes the validation state of the control, e.g. When called with a value of Default value is |
setValueStateText |
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 |
setWidth |
Sets a new value for property width. Defines the width of the control. When called with a value of Default value is |
unbindValue |
Unbinds property value from model data. |
Adds some ariaLabelledBy into the association ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to add; if empty, nothing is inserted |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
Binds property value to model data.
See ManagedObject.bindProperty for a detailed description of the possible properties of oBindingInfo
Param | Type | DefaultValue | Description |
---|---|---|---|
oBindingInfo | sap.ui.base.ManagedObject.PropertyBindingInfo |
The binding information |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Fires event change to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
value | string |
The string value of the control in given valueFormat (or locale format). |
|
dateValue | object |
The value of control as JavaScript Date Object or null if value is empty. |
|
valid | boolean |
if set, the entered value is a valid date. If not set the entered value cannot be converted to a date. |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
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.
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.
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
.
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
.
Gets current value of property name.
Defines the name of the control for the purposes of form submission.
Gets current value of property placeholder.
Defines a short hint intended to aid the user with data entry when the control has no value.
Gets current value of property showValueStateMessage.
Indicates whether the value state message should be shown or not.
Default value is true
.
Gets current value of property textAlign.
Defines the horizontal alignment of the text that is shown inside the input field.
Default value is Initial
.
Gets current value of property textDirection.
Defines the text directionality of the input field, e.g. RTL
, LTR
Default value is Inherit
.
Gets current value of property type.
Type of DateTimeInput (e.g. Date, Time, DateTime)
Default value is Date
.
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.
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.
Gets current value of property valueState.
Visualizes the validation state of the control, e.g. Error
, Warning
, Success
.
Default value is None
.
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.
Gets current value of property width.
Defines the width of the control.
Default value is "100%"
.
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | int sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to be removed or its index or ID |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
oDateValue | object |
New value for property |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sDisplayFormat | string |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bEditable | boolean | true |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bEnabled | boolean | true |
New value for property |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sName | string |
New value for property |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sPlaceholder | string |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bShowValueStateMessage | boolean | true |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTextAlign | sap.ui.core.TextAlign | Initial |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTextDirection | sap.ui.core.TextDirection | Inherit |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sType | sap.m.DateTimeInputType | Date |
New value for property |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sValue | string |
New value for property |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sValueFormat | string |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sValueState | sap.ui.core.ValueState | None |
New value for property |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sValueStateText | string |
New value for property |
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%"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize | "100%" |
New value for property |