[TIMOB-15908] iOS:Picker: getValue method for picker returns incorrect time
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2013-12-06T18:32:22.000+0000 |
| Affected Version/s | Release 3.2.0 |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | qe-3.2.0 |
| Reporter | Priya Agarwal |
| Assignee | Sabil Rahim |
| Created | 2013-12-06T06:10:17.000+0000 |
| Updated | 2013-12-11T10:36:15.000+0000 |
Description
getValue method for picker returns incorrect time for both PICKER_TYPE_DATE and
PICKER_TYPE_DATE_AND_TIME Picker.
Works fine on Android.
Not regression as issue occurs on 3.1.3.GA also.
var win = Ti.UI.createWindow();
var picker = Ti.UI.createPicker({
type : Ti.UI.PICKER_TYPE_DATE_AND_TIME,
selectionIndicator : 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);
win.add(view);
win.open();
Steps to reproduce:
1)Copy paste the code and run the app.
2)Click on Show Date button.
Actual Result:
2)Shows correct date and but incorrect time.
Expected Result:
2)Should show correct date and time.
Screen Shot shows the device correct time as 11:38am but the alert shows the incorrect time.
Attachments
| File | Date | Size |
|---|---|---|
| wrongtime.png | 2013-12-06T06:10:17.000+0000 | 66128 |
Invalid ticket. Picker time always returns value in GMT . The values should be converted to locale values. Updated test code
essentially dovar win = Ti.UI.createWindow({backgroundColor:'white'}); var picker = Ti.UI.createPicker({ type : Ti.UI.PICKER_TYPE_DATE_AND_TIME, selectionIndicator : true, }); var showDate = Ti.UI.createButton({ title : 'show date', bottom : 20 }); showDate.addEventListener('click', function(e) { alert(picker.getValue().toLocaleString()); }); var view = Ti.UI.createView({ width : Ti.UI.FILL, height : Ti.UI.FILL }); view.add(picker); view.add(showDate); win.add(view); win.open();alert(picker.getValue().toLocaleString());Marking ticket as invalidTested Environment: Appcelerator Studio: 3.2.0.201312101708 SDK:3.2.0.v20131210191510 alloy: 1.3.0-cr acs: 1.0.10 npm: 1.3.2 titanium: 3.2.0-cr titanium-code-processor: 1.1.0-cr Xcode:5.0.2 OS: Mac OSX 10.9 Device: iPhone Simulator(v7.0.3) Working fine. Used the above mentioned code to verify. Hence closing the issue