Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1462] Countdown Picker returns the wrong values in 1.4.0 & sdk 4

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2012-07-02T15:40:06.000+0000
Affected Version/sn/a
Fix Version/sSprint 2012-13 API, Release 3.0.0
ComponentsiOS
Labelsapi, countdown, defect, ios, iphone, picker, qe-review, qe-testadded
Reporterctredway
AssigneeVishal Duggal
Created2011-04-15T02:53:30.000+0000
Updated2013-12-06T10:26:19.000+0000

Description

A customer submitted a ticket in the helpdesk that with iOS 4 and 1.4.0 the count down picker is not returning the proper values. I see the same behavior.

CODE

var win1 = Titanium.UI.createWindow({

backgroundColor:'black'

});

var duration = 60000 * 5; // 5 minutes

var picker = Ti.UI.createPicker({

type:Ti.UI.PICKER_TYPE_COUNT_DOWN_TIMER,
countDownDuration:duration

});

picker.selectionIndicator = true;

win1.add(picker);

picker.addEventListener('change',function(e)
{

Ti.API.info('value = ' + picker.value);

});

win1.open({modal:false});
########################

CONSOLE OUTPUT
[INFO] value = Wed Nov 29 0000 23:58:58 GMT-0800 (PST) [INFO] value = Wed Nov 29 0000 23:59:58 GMT-0800 (PST) [INFO] value = Thu Nov 30 0000 00:00:58 GMT-0800 (PST) [INFO] value = Thu Nov 30 0000 00:01:58 GMT-0800 (PST) [INFO] value = Thu Nov 30 0000 00:02:58 GMT-0800 (PST)

Comments

  1. Vishal Duggal 2012-06-25

    Test case
       var win1 = Titanium.UI.createWindow({
       	backgroundColor:'black'
       });
       
       var duration = 60000 * 5; // 5 minutes
       
       var picker = Ti.UI.createPicker({
       	type:Ti.UI.PICKER_TYPE_COUNT_DOWN_TIMER,
       	countDownDuration:duration
       });
       
       picker.selectionIndicator = true;
       
       win1.add(picker);
       
       picker.addEventListener('change',function(e)
       {
       	Ti.API.info('change');
       	Ti.API.info('Obj countDownDuration = ' + picker.countDownDuration);
       	Ti.API.info('Evt countDownDuration = ' + e.countDownDuration);
       });
       
       
       win1.open();
       
  2. Vishal Duggal 2012-06-25

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/2465
  3. Blain Hamon 2012-07-02

    Pull merged.
  4. Natalie Huynh 2012-12-04

    Tested with 3.0.0.v20121130200208 with iPhone 4 5.1.1
  5. jithinpv 2013-12-06

    Anvil test case added. PR Link: https://github.com/appcelerator/titanium_mobile/pull/5078

JSON Source