Problem description
When i call getValue() of date picker it returns null. It is necessary to store the date value form the picker 'change' event to be able to retrieve it.
Steps to reproduce
Use the following code to reproduce:
var mainWindow = Ti.UI.createWindow({
title : 'Lab',
backgroundColor : 'white',
fullscreen : false,
navBarHidden : true,
exitOnClose : true,
orientationModes : [Titanium.UI.PORTRAIT]
});
var picker = Ti.UI.createPicker({
type : Ti.UI.PICKER_TYPE_DATE,
selectionIndicator : true,
useSpinner : true
});
var showDate = Ti.UI.createButton({
title : 'show date',
bottom : 20
});
showDate.addEventListener('click', function(e) {
alert(picker.getValue());
});
var view = Ti.UI.createView({
width : Ti.UI.FILL,
height : Ti.UI.FILL
});
view.add(picker);
view.add(showDate);
mainWindow.add(view);
mainWindow.open();
Verified occurs with sample code above and: SDK: 2.1.3.GA SDK 3.0.0.GA SDK: 3.0.2.GA SDK: 3.1.0.v20130314120115 Titanium Studio, build: 3.0.2.201302191606
PR https://github.com/appcelerator/titanium_mobile/pull/4037
getValue() method is returning the appropriate values on alert. Verified on: Device : iPad mini, iOS version: 6+ SDK: 3.1.0.v20130405170202 CLI version : 3.1.0-beta OS : MAC OSX 10.7.5 Appcelerator Studio, build: 3.1.0.201304011603