Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3329] Android: format24 on picker not working

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-05-03T12:23:56.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-14
ComponentsAndroid
Labelsandroid, feature, format, klist, picker, release-1.7.0, rplist
ReporterAlan Leard
AssigneeBill Dawson
Created2011-04-15T03:42:15.000+0000
Updated2011-05-03T12:23:56.000+0000

Description

Problem

format24:false still returns 24 hour time in the picker

Test Code Tested on 1.6 and 1.7 (03/10/11) APIs 2.1 & 2.2

var win = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
var picker = Ti.UI.createPicker({
           top: 20,
           type: Ti.UI.PICKER_TYPE_TIME,
           minuteInterval: 30,
           useSpinner: true
         });
win.add(picker);
win.open();

Ticket Reference

http://developer.appcelerator.com/helpdesk/view/76372">http://developer.appcelerator.com/helpdesk/view/76372

Comments

  1. Zipcar (Goss) 2011-04-15

    I have some code that may be relevant to this, planning to submit a pull request later this week.

  2. Bill Dawson 2011-04-15

    This is not a defect, so I removed the "defect" tag and put in "feature". This was an undocumented flag, precisely because it was an unimplemented feature. :)

    Nice test app.js for QE:

       /*global Ti, Titanium, alert, JSON, require, setTimeout, setInterval */
       Titanium.UI.setBackgroundColor('#000');
       var win = Titanium.UI.createWindow({  
           title:'Test',
           backgroundColor:'#000',
           exitOnClose: true
       });
       
       var lbl = Ti.UI.createLabel({
           bottom: "10dp", height: "40dp", left: 5, right: 5,
           backgroundColor: 'blue', color: 'yellow'
       });
       win.add(lbl);
       
       var p = Ti.UI.createPicker({
           type: Ti.UI.PICKER_TYPE_TIME, useSpinner:true, format24:false,
           top: 10, height: 'auto', width: 'auto'
       });
       p.addEventListener('change', function(e){
           lbl.text = e.value;
       });
       win.add(p);
       
       var btn = Ti.UI.createButton({
           bottom: "60dp", height: "40dp", left: 5, right: 5,
           title: 'Set to now'
       });
       win.add(btn);
       btn.addEventListener('click', function(){
           p.value = new Date();
       });
       
       var btn2 = Ti.UI.createButton({
           bottom: "105dp", height: "40dp", left: 5, right: 5,
           title: 'toggle am/pm'
       });
       win.add(btn2);
       btn2.addEventListener('click', function(){
           var format24 = p.format24;
           if (format24) {
               format24 = false;
           } else {
               format24 = true;
           }
           p.format24 = format24;
       });
       
       var btn3 = Ti.UI.createButton({
           bottom: "150dp", height: "40dp", left: 5, right: 5,
           title: 'check time'
       });
       win.add(btn3);
       btn3.addEventListener('click', function(){
           lbl.text = p.value;
       });
       win.open();
       
  3. Don Thorp 2011-05-03

    Tested on Nexus One 2.3.3.

JSON Source