Feature Request
As of API Level 11 there is a picker property called calendarViewShown which will show a calendar as a part of the date picker view as shown in the attached screen shot.
Original Community Request
when using the date picker i get a picker with three columns (day, month and year) but ALSO i am getting a calendar like box on the right containing the number of days. how can i remove the calendar box and keep the picker columns?? i am compiling against android 3.2 SDK
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>13</tool-api-level>
<manifest>
<uses-sdk android:targetSdkVersion="13" android:minSdkVersion="13"/>
<!--
<uses-sdk android:minSdkVersion="10"/>
-->
</manifest>
</android>
my code:
var minDate = new Date();
var curMonth = 0;
for (var i = 0; i < 12; i++) {
curMonth = minDate.getMonth();
curMonth--;
minDate.setMonth(curMonth);
}
var now = new Date();
this.visitDatePicker = Ti.UI.createPicker({
type : Ti.UI.PICKER_TYPE_DATE,
maxDate : now,
value : now,
minDate : minDate,
selectionIndicator : true
});
posted problem on the forum but didn't get any suggestions yet
http://developer.appcelerator.com/question/147296/date-picker-with-box-calendar-like-days-on-the-right
Please provide a screenshot of what you are seeing. I can only see month, day year.
Attached date picker with days box at the right. thank you
hello Alan, any thought on why i have such a rendering of the date-picker?
Please try setting your target and min SDK to 10 and confirm if the calendar still appears.
Ok I will try it, but this will cause the app to use android old UI components right?
on API version 10 the application shows the old UI of date picker and the user manually change the date when clicking in the picker text. any ideas why i am getting a weird picker with API 13?
Yes, the calendarViewShown attribute was added in API level 11 but the attribute is not currently available through Titanium. I will move this ticket and make it a feature request for our future SDK release to expose that as a property. Reference: http://developer.android.com/reference/android/widget/DatePicker.html
ok thanks for the followup
hello, Do you have any idea when the fix will be released?
Also wondering when this is scheduled for a fix. This is a deal breaker for an app I am currently working on.
Hi All. We will attempt to fix this in 3.2.0
please try to include it with Release 3.1.0 on 16th of April. Regards
start working
added a new property calendarViewShown https://github.com/appcelerator/titanium_mobile/pull/4328
we have to wait until the end of September for this fix to filter through via v3.2? ...seriously?!
[~jimmyrocket] We only include new features in major releases. If you like, there is a pull request already--you could add it to a custom build of the SDK for your purposes.
[~sameeh.harfoush], [~johnnysc22], [~jimmyrocket] A workaround for those who can't wait til September or don't want to spend time building a custom version of the SDK. Tested and confirmed on Titanium SDK 3.0.2 w/ T-Mobile Samsung Galaxy S2 running CM10.1-20130423-NIGHTLY. datepicker.xml:
datepicker.tss:
To adjust the width of the date picker, change the width of #datePickerContainer. Leave the #datePicker width set to 205% to ensure that the calendar view is "off right" of #datePickerContainer.
[~bijuexalture], Please add a reproducible test case to this. I tried with the galaxy s3 with the following code snippet with no luck:
For those who can't wait, a simple workaround is to use showDatePickerDialog() method. In the modal window calendar is not present.
showDatePickerDialog() is randomly crashing the app with the following:
Any news on this ??
New Test case:
Note : Default value of calendarViewShown is false
Steps to reproduce:
step 1 : Run the above code step 2 : Click the hide button Actual result getting a calendar like box on the right containing the number of days expected result show a calendar as a part of the date picker ( a picker with three columns (day, month and year) )PR:- https://github.com/appcelerator/titanium_mobile/pull/4667
CR + FR
Verified with environment: Appc-Studio: 3.2.0.201310092427 Sdk:3.2.0.v20131008154043 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Google Nexus 7(v4.3) Xcode: 5 Calendar being shown on button click on Picker.