Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8430] Android: TimePicker - Switching between am and pm time does not makes changes in time format on the top of the page

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-05-19T20:01:33.000+0000
Affected Version/sRelease 2.0.0, Release 3.1.0
Fix Version/sRelease 6.1.0
ComponentsAndroid
Labelsmerge-6.1.0, qe-and031912
ReporterTamila Smolich
AssigneeJoshua Quick
Created2012-03-29T16:15:55.000+0000
Updated2017-05-19T20:57:18.000+0000

Description

Description: Switching between am and pm time does not makes changes in time format on the top of the page. Also occurs on Motorola Xoom 4.0.3, and on both devices on 1.8.2 Steps: 1. Run KitchenSink 2. Go to Controls-Picker-Time picker 3. Choose a time 4. Switch time format Expected result: Time in correct time format should be shown on the top of the page Actual result: Time format on the top of the page is incorrect

Attachments

FileDateSize
device-2012-03-29-164900.png2012-03-29T16:15:55.000+000042329

Comments

  1. Justin Toth 2012-11-30

    I just ran into this bug too so will provide some additional information. It doesn't happen on the Android emulator at all, it only happens on devices. It works correctly if you change the AM/PM and then change the hours or minutes *after* before pressing OK, the AM/PM change only doesn't save if you change the AM/PM last and then press OK. Reproduced on: Samsung Galaxy SIII Samsung Galaxy Tab
  2. Justin Toth 2012-11-30

    The picker's "change" event doesn't fire when the AM/PM is changed on an Android device, even though it fires when you change the hours or minutes. The getValue() doesn't update either when AM/PM is changed, so there is no workaround that I can see for this...
  3. David Bankier 2013-01-30

    It is an android issue. See the following: http://code.google.com/p/android/issues/detail?id=18982
  4. Shameer Jan 2013-03-15

    The problem reproduces with release 3.0.2 and master release 3.1.0 tested on Titanium Studio, build: 3.0.2.201302191606 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4 Android Emulator: Android SDK version: 2.2 iOS iPhone Simulator: iOS SDK version: 6.0 It works fine on IOS iphone simulator
  5. Mike Stancliffe 2016-02-08

    This still seems to be a problem in 5.1.2, any updates on it?
  6. Ashraf Abu 2016-02-10

    [~cliff_stander] Could you give the code that you are using? And also more information on the device and android version you are using that's facing this issue.
  7. Kelly Corn 2016-02-11

    Using a Nexus 6, Android 6.0.1. Selecting AM when PM is default (or vice versa) does not trigger change event as it does on iOS. User must change the hour to trigger the change event. Sample code:
          var win1 = Titanium.UI.createWindow({
          backgroundColor:'#fff',
          layout: 'vertical'
       });
       
       var label1 = Titanium.UI.createLabel({
       	color:'#999',
       	text:'Set the time below',
       	font:{fontSize:20,fontFamily:'Helvetica Neue'},
       	textAlign:'center',
       	width:'auto',
       	top: '40'
       });
       
       var picker1 = Titanium.UI.createPicker({
       	type: Ti.UI.PICKER_TYPE_TIME,
       	top: '20'
       });
       
       picker1.addEventListener('change', function(e) {
       	label1.text = picker1.value;
       	Ti.API.info(picker1.value);
       });
       
       win1.add(label1);
       win1.add(picker1);
       
       win1.open();
       
  8. Kiley Williams 2016-08-06

    What's the status on this? Sounds like the underlying Android issue may need to be worked around...
  9. Farzad Merzadyan 2016-10-18

    In the meantime, use either nativeSpinner or useSpinner properties which comes without the AM/PM button.
       //usage example of nativeSpinner and useSpinner. 
       //only one property must be true otherwise nativeSpinner overpowers useSpinner property
       var timePicker = Titanium.UI.createPicker({
           type: Ti.UI.PICKER_TYPE_TIME,
           top: '20',
           nativeSpinner: true,
           useSpinner: false
       });
       
  10. Frankie Merzadyan 2017-01-27

    master: https://github.com/appcelerator/titanium_mobile/pull/8799 6_1_0: https://github.com/appcelerator/titanium_mobile/pull/9026
  11. Joshua Quick 2017-05-15

    *Note to QE:* I can only reproduce this issue if my "tiapp.xml" is set up to run the JavaScript engine on another thread (ie: not the main UI thread).
        <ti:app xmlns:ti="http://ti.appcelerator.org">
            <property name="run-on-main-thread" type="bool">false</property>
        </ti:app>
        
  12. Lokesh Choudhary 2017-05-16

    [~jquick], I am running on the Main thread.
    <property name="run-on-main-thread" type="bool">true</property>
  13. Joshua Quick 2017-05-16

    [~lchoudhary], [~mchen] and [~fmerzadyan] have came up with a simpler solution to this bug (it's a 2 line fix). A new or updated PR will be coming soon.
  14. Joshua Quick 2017-05-17

    The "master" and "6.1.0" PRs have been updated and reviewed. They're ready to be tested.
  15. Lokesh Choudhary 2017-05-18

    FR Failed. On Android 5.1.1. & 6.0.1 the change event does not fire when I change From AM to PM & vice versa. But, if you change from e.g AM toPM, I have to tap on the hour or minute for the change event to fire.
  16. Lokesh Choudhary 2017-05-19

    Backport PR merged.
  17. Lokesh Choudhary 2017-05-19

    Verified the fix. Switching between am and pm fires the change event successfully every time. Closing. Studio Ver: 4.9.0.201705170123 SDK Ver: 6.1.0.v20170519130656 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.2 Appc NPM: 4.2.9 Appc CLI: 6.2.1 Ti CLI Ver: 5.0.13 Alloy Ver: 1.9.11 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 6 --- Android 6.0.1 ⇨ google Pixel XL --- Android 7.1.1

JSON Source