Titanium JIRA Archive
Appcelerator Community (AC)

[AC-303] Date Picker (Calendar View) on Android 5.0 not detecting selection.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-11-14T00:56:21.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsandroid-5, datepicker, lollipop
ReporterPaul Flood
AssigneeShak Hossain
Created2015-08-14T14:19:56.000+0000
Updated2015-11-14T00:56:21.000+0000

Description

Using the example code found in the Kitchen Sink shown below the selection made on the calendar has no effect. The changed event listener doesn't detect any interaction. On Android 5.1 the code works fine. All versions before 5.0 use the Android UI spinner not the 'usespinner:true' version and work fine.

	var minDate = new Date();
	minDate.setFullYear(2009);
	minDate.setMonth(0);
	minDate.setDate(1);
	
	var maxDate = new Date();
	maxDate.setFullYear(2009);
	maxDate.setMonth(11);
	maxDate.setDate(31);
	
	var value = new Date();
	value.setFullYear(2009);
	value.setMonth(0);
	value.setDate(1);
	
	var picker = Ti.UI.createPicker({
		type:Ti.UI.PICKER_TYPE_DATE,
		minDate:minDate,
		maxDate:maxDate,
		value:value,
		calendarViewShown: false
	});
	
	// turn on the selection indicator (off by default)
	picker.selectionIndicator = true;
	
	picker_Win.add(picker);
	
	var label = Ti.UI.createLabel({
		text:'Choose a date',
		top:6,
		width:'auto',
		height:'auto',
		textAlign:'center',
		color:'white'
	});
	picker_Win.add(label);
	
	picker.addEventListener('change',function(e)
	{
		label.text = e.value.toLocaleString();
	});

Attachments

FileDateSize
Screen Shot 2015-08-13 at 20.46.34.png2015-08-14T14:17:38.000+000065043

Comments

  1. Paul Flood 2015-08-14

    Found a workaround for this but the calendar view issue is still there. Details on the workaround are here https://community.appcelerator.com/topic/2989/android-5-0-datepicker-not-working/2.
  2. Aminul Islam 2015-11-13

    Tested this issue in our updated environment. Date Picker *change* event is now working for android 5.0.0 with latest SDK. I tested this using the 5.1.0.v20151104190037 and Google Nexus 6 - 5.0.0 - API 21 - 1440x2560. *change* event log
       [INFO] :   chenged
       [INFO] :   chenged
       [INFO] :   chenged
       [INFO] :   chenged
       [INFO] :   chenged
       
    *Environment*
       Operating System
         Name                        = Mac OS X
         Version                     = 10.10.5
         Architecture                = 64bit
         # CPUs                      = 4
         Memory                      = 8589934592
       Node.js
         Node.js Version             = 0.10.37
         npm Version                 = 1.4.28
       Titanium CLI
         CLI Version                 = 5.0.5
       Titanium SDK
         SDK Version                 = 5.1.0.v20151104190037
         SDK Path                    = /Users/Library/Application Support/Titanium/mobilesdk/osx/5.1.0.v20151104190037
         Target Platform             = android
       

JSON Source