[TIMOB-10995] iOS: Time Picker minuteInterval does not set value correctly for minutes
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-11-16T22:11:24.000+0000 |
Affected Version/s | Release 2.1.2, Release 2.1.3, Release 3.0.0 |
Fix Version/s | Release 3.1.0, 2012 Sprint 23 API, 2012 Sprint 23 |
Components | iOS |
Labels | api, qe-port |
Reporter | Rob Scheibel |
Assignee | Vishal Duggal |
Created | 2012-09-19T11:10:13.000+0000 |
Updated | 2014-06-19T12:42:35.000+0000 |
Description
If you create a time picker and set the minuteInterval property equal to '20' then try to set the value to 9:20, it sets the value to 9:40. Similarly if you try 9:40 it sets it to 9:20. Seems to be some bug with the setting of the minutes. If I remove the minuteInterval property, then it sets the time correctly. Some example code:
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var origstarthour = 9;
var origstartminute = 40;
var today = new Date();
var starttimepicker = Ti.UI.createPicker({
type:Ti.UI.PICKER_TYPE_TIME,
minDate:new Date(today.getFullYear(),today.getMonth()+1,today.getDate(),9,0,0),
maxDate:new Date(today.getFullYear(),today.getMonth()+1,today.getDate(),13,40,0),
value:new Date(today.getFullYear(),today.getMonth()+1,today.getDate(),origstarthour,origstartminute,0),
minuteInterval:20,
top:110,
left:0
});
win.add(starttimepicker);
win.open();
Tested and confirmed on iOS Simulator 5.1, TiSDK 2.1.2, 2.1.3 and 3.0.0. When minuteInterval has the values 20, 5 or 2 and 'origstartminute' is set to 40, it sets the initial minutes in the picker to 20; and when it's set to 20, it sets the initial minutes in the picker to 40.
Pull ending https://github.com/appcelerator/titanium_mobile/pull/3384
It is setting values for minutes correctly. Environment used for verification - Titanium SDK: 3.1.0.v20130114171802 Titanium Studio: 3.0.1.201212181159 Device : Simulator iOS 6.0, iPHONE 3G S iOS 5.0.1