Class sap.ui.commons.DatePickerModule: sap/ui/commons/DatePicker

extends TextField

Allows end users to interact with dates. Entries can directly be written in, or selected from a calendar pad. Note: Dates can always be manually entered in the fix YYYYMMDD format, on top of the flexible "locale" format. If the value is provided via data binding, using a Date.type the formatter of the Date.type is used. Since version 1.22 the unified.Calendar is used inside the datePicker. So applications using the DatePicker should load the unified library. Otherwise it will be loaded the first time a DatePicker is opened.

Deprecated API:Since version 1.38. Instead, use the sap.m.DatePicker control.

Constructor Summary
new sap.ui.commons.DatePicker(sId?, mSettings?)Constructor for a new DatePicker.
Events borrowed from class sap.ui.commons.TextField
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.DatePicker.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.DatePicker with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.DatePicker.getMetadata()Returns a metadata object for class sap.ui.commons.DatePicker.
fireChange(bInvalidValue)Fire event change to attached listeners.
getLocale()Gets current value of property locale.
getYyyymmdd()Gets current value of property yyyymmdd.
setLocale(sLocale)Sets a new value for property locale.
setYyyymmdd(sYyyymmdd)Sets a new value for property yyyymmdd.
Constructor Detail
new sap.ui.commons.DatePicker(sId?, mSettings?)
Constructor for a new DatePicker.

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.commons.TextField 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.38. Instead, use the sap.m.DatePicker control.
Method Detail
sap.ui.commons.DatePicker.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.commons.DatePicker 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.commons.TextField.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.commons.DatePicker.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.DatePicker.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
fireChange(bInvalidValue): sap.ui.commons.DatePicker
Fire event change to attached listeners.

Provides the following event parameters:

  • 'newValue' of type string The new / changed value of the DatePicker.
  • 'newYyyymmdd' of type string The new / changed Yyyymmdd of the DatePicker.
  • 'invalidValue' of type boolean The new / changed value of the DatePicker is not a valid date.
Parameters:
{boolean}bInvalidValue true is value is invalid
Returns:
{sap.ui.commons.DatePicker}this to allow method chaining
getAccessibilityInfo()
See:
{sap.ui.core.Control#getAccessibilityInfo}
getLocale(): string
Gets current value of property locale.

Defines the locale (language and country), e.g. "en-US", whose translations and Date formatters should be used to render the DatePicker.If the value property is bound to a model using a Date type the locale will be ignored, because the locale information of the model are used.

Returns:
{string} Value of property locale
getYyyymmdd(): string
Gets current value of property yyyymmdd.

Defines the date as a "yyyymmdd" string, independent from the format used. The inherited textField "value" attribute uses the date format as configured via the locale. The date is interpreted as gregorian date

Returns:
{string} Value of property yyyymmdd
setLocale(sLocale): sap.ui.commons.DatePicker
Sets a new value for property locale.

Defines the locale (language and country), e.g. "en-US", whose translations and Date formatters should be used to render the DatePicker.If the value property is bound to a model using a Date type the locale will be ignored, because the locale information of the model are used.

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

Parameters:
{string}sLocale New value for property locale
Returns:
{sap.ui.commons.DatePicker} Reference to this in order to allow method chaining
setYyyymmdd(sYyyymmdd): sap.ui.commons.DatePicker
Sets a new value for property yyyymmdd.

Defines the date as a "yyyymmdd" string, independent from the format used. The inherited textField "value" attribute uses the date format as configured via the locale. The date is interpreted as gregorian date

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

Parameters:
{string}sYyyymmdd New value for property yyyymmdd
Returns:
{sap.ui.commons.DatePicker} Reference to this in order to allow method chaining