[TIMOB-16173] Android: showDatePickerDialog and showTimePickerDialog ignore minDate and maxDate attributes
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2014-08-21T21:42:01.000+0000 |
| Affected Version/s | Release 3.2.0 |
| Fix Version/s | Release 3.4.2, Release 3.5.0 |
| Components | Android |
| Labels | android, module_picker, qe-manualtest, qe-testadded, showDatePickerDialog, showTimePickerDialog |
| Reporter | Jan Helleman |
| Assignee | Sunila |
| Created | 2014-01-10T09:17:29.000+0000 |
| Updated | 2014-11-21T18:49:36.000+0000 |
Description
The picker completely ignores the minDate and maxDate when shown as dialog. Code to reproduce:
var pickerTime = Ti.UI.createPicker({
//value: now,
value: $.startDateTime.toDate(),
type: Titanium.UI.PICKER_TYPE_TIME,
maxDate: new Date(),
format24: true
});
pickerTime.showTimePickerDialog({format24: true});
var pickerDate = Ti.UI.createPicker({
value: now,
maxDate: new Date(),
minDate: new Date(),
type: Titanium.UI.PICKER_TYPE_DATE
});
pickerDate.showDatePickerDialog();
Attachments
| File | Date | Size |
|---|---|---|
| app.js | 2014-10-06T21:52:54.000+0000 | 724 |
Moving this ticket to engineering as I was not able to make showDatePickerDialog and showTimePickerDialog work using the simple sample provided in the documentation. Note that adding a date or time picker to a window works fine so the issue is specific to showDatePickerDialog and showTimePickerDialog methods. http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Picker-method-showDatePickerDialog
Ti.UI.backgroundColor = 'white'; var win = Ti.UI.createWindow({ exitOnClose: true, layout: 'vertical' }); var picker = Ti.UI.createPicker({ type:Ti.UI.PICKER_TYPE_DATE, minDate:new Date(2009,0,1), maxDate:new Date(2014,11,31), value:new Date(2014,3,12) }); win.open(); picker.showDatePickerDialog({ value: new Date(2010,8,1), callback: function(e) { if (e.cancel) { Ti.API.info('User canceled dialog'); } else { Ti.API.info('User selected date: ' + e.value); } } });Bug still exist. Please fix.
3.4.0 is moved forward, and 3.5.0 is taking its place in the calendar.
https://github.com/appcelerator/titanium_mobile/pull/5977 Added support for minDate and maxDate in showDatePickerDialog. Code check the proxy if the minDate, maxDate values are not passed in.
Verified fix on: Mac OSX 10.9.5 Appcelerator Studio, build: 3.4.0.201409261245 Titanium SDK build: 3.5.0.v20141003114918 Titanium CLI, build: 3.5.0-dev Alloy: 1.5.1 Android Emulator 4.4.2, Android Device S3 4.0.4 Using the attached app.js built to both device and emulator and the minDate and maxDate attributes are respected. Closing ticket.