src/sap.m/src/sap/m/DateTimeInput.js
function buildPickerByType(type){
		var oPicker;

		switch (type) {
			case DateTimeInputType.DateTime:
				oPicker = new DateTimePicker(this.getId() + "-Picker");
				break;

			case DateTimeInputType.Time:
				oPicker = new TimePicker(this.getId() + "-Picker",
					{localeId: sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale().toString()});
				break;

			default: // default is date
				oPicker = new DatePicker(this.getId() + "-Picker");
				break;
		}

		// forward properties (also set default, may be different)
		oPicker.setDisplayFormat(this.getDisplayFormat() || this._types[type].displayFormat);
		oPicker.setValueFormat(this.getValueFormat() || this._types[type].valueFormat);
		if (this.getDateValue()) {
			oPicker.setDateValue(this.getDateValue()); // don't set Value -> as by switching type information can be lost
		}
		oPicker.setEnabled(this.getEnabled());
		oPicker.setEditable(this.getEditable());
		oPicker.setValueState(this.getValueState());
		oPicker.setValueStateText(this.getValueStateText());
		oPicker.setShowValueStateMessage(this.getShowValueStateMessage());
		oPicker.setName(this.getName());
		oPicker.setPlaceholder(this.getPlaceholder());
		oPicker.setTextAlign(this.getTextAlign());
		oPicker.setTextDirection(this.getTextDirection());
		oPicker.setWidth("100%");
		oPicker.attachChange(_handleChange, this);

		var aAriaLabelledBy = this.getAriaLabelledBy();
		for (var i = 0; i < aAriaLabelledBy.length; i++) {
			oPicker.addAriaLabelledBy(aAriaLabelledBy[i]);
		}
		return oPicker;
	}
function buildPickerByType(type){
		var oPicker;

		switch (type) {
			case DateTimeInputType.DateTime:
				oPicker = new DateTimePicker(this.getId() + "-Picker");
				break;

			case DateTimeInputType.Time:
				oPicker = new TimePicker(this.getId() + "-Picker",
					{localeId: sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale().toString()});
				break;

			default: // default is date
				oPicker = new DatePicker(this.getId() + "-Picker");
				break;
		}

		// forward properties (also set default, may be different)
		oPicker.setDisplayFormat(this.getDisplayFormat() || this._types[type].displayFormat);
		oPicker.setValueFormat(this.getValueFormat() || this._types[type].valueFormat);
		if (this.getDateValue()) {
			oPicker.setDateValue(this.getDateValue()); // don't set Value -> as by switching type information can be lost
		}
		oPicker.setEnabled(this.getEnabled());
		oPicker.setEditable(this.getEditable());
		oPicker.setValueState(this.getValueState());
		oPicker.setValueStateText(this.getValueStateText());
		oPicker.setShowValueStateMessage(this.getShowValueStateMessage());
		oPicker.setName(this.getName());
		oPicker.setPlaceholder(this.getPlaceholder());
		oPicker.setTextAlign(this.getTextAlign());
		oPicker.setTextDirection(this.getTextDirection());
		oPicker.setWidth("100%");
		oPicker.attachChange(_handleChange, this);

		var aAriaLabelledBy = this.getAriaLabelledBy();
		for (var i = 0; i < aAriaLabelledBy.length; i++) {
			oPicker.addAriaLabelledBy(aAriaLabelledBy[i]);
		}
		return oPicker;
	}
function buildPickerByType ( type ) { var oPicker ; switch ( type ) { case DateTimeInputType . DateTime : oPicker = new DateTimePicker ( this . getId ( ) + "-Picker" ) ; break ; case DateTimeInputType . Time : oPicker = new TimePicker ( this . getId ( ) + "-Picker" , { localeId : sap . ui . getCore ( ) . getConfiguration ( ) . getFormatSettings ( ) . getFormatLocale ( ) . toString ( ) } ) ; break ; default : // default is date oPicker = new DatePicker ( this . getId ( ) + "-Picker" ) ; break ; } // forward properties (also set default, may be different) oPicker . setDisplayFormat ( this . getDisplayFormat ( ) || this . _types [ type ] . displayFormat ) ; oPicker . setValueFormat ( this . getValueFormat ( ) || this . _types [ type ] . valueFormat ) ; if ( this . getDateValue ( ) ) { oPicker . setDateValue ( this . getDateValue ( ) ) ; // don't set Value -> as by switching type information can be lost } oPicker . setEnabled ( this . getEnabled ( ) ) ; oPicker . setEditable ( this . getEditable ( ) ) ; oPicker . setValueState ( this . getValueState ( ) ) ; oPicker . setValueStateText ( this . getValueStateText ( ) ) ; oPicker . setShowValueStateMessage ( this . getShowValueStateMessage ( ) ) ; oPicker . setName ( this . getName ( ) ) ; oPicker . setPlaceholder ( this . getPlaceholder ( ) ) ; oPicker . setTextAlign ( this . getTextAlign ( ) ) ; oPicker . setTextDirection ( this . getTextDirection ( ) ) ; oPicker . setWidth ( "100%" ) ; oPicker . attachChange ( _handleChange , this ) ; var aAriaLabelledBy = this . getAriaLabelledBy ( ) ; for ( var i = 0 ; i < aAriaLabelledBy . length ; i ++ ) { oPicker . addAriaLabelledBy ( aAriaLabelledBy [ i ] ) ; } return oPicker ; }
Creates an instance of picker depending of the given property type
@param {sap.m.DateTimeInputType} type the type
@returns {sap.ui.core.Control} picker implementation, that may be one of <code>sap.m.DatePicker</code>,
<code>sap.m.TimePicker</code> or <code>sap.m.DateTimePicker</code>.
Creates an instance of picker depending of the given property type