Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10995] iOS: Time Picker minuteInterval does not set value correctly for minutes

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-11-16T22:11:24.000+0000
Affected Version/sRelease 2.1.2, Release 2.1.3, Release 3.0.0
Fix Version/sRelease 3.1.0, 2012 Sprint 23 API, 2012 Sprint 23
ComponentsiOS
Labelsapi, qe-port
ReporterRob Scheibel
AssigneeVishal Duggal
Created2012-09-19T11:10:13.000+0000
Updated2014-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();

Comments

  1. Daniel Sefton 2012-09-19

    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.
  2. Vishal Duggal 2012-11-06

    Pull ending https://github.com/appcelerator/titanium_mobile/pull/3384
  3. Shyam Bhadauria 2013-01-21

    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

JSON Source