[TIMOB-25917] Android: Allow picker minDate/maxDate properties to be set dynamically
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-07-09T23:52:35.000+0000 |
Affected Version/s | Release 7.1.0 |
Fix Version/s | Release 7.3.0 |
Components | Android, TiAPI |
Labels | android, parity, picker |
Reporter | Rene Pot |
Assignee | Yordan Banev |
Created | 2018-03-30T13:15:35.000+0000 |
Updated | 2018-07-09T23:52:38.000+0000 |
Description
On iOS it is possible to change the minDate/maxDate on runtime, on Android this is not possible due to TiSDK constraint in the code.
Test code
var win = Ti.UI.createWindow({
title: 'Form',
});
/*
// working
var dp = Ti.UI.createPicker({
type: Ti.UI.PICKER_TYPE_DATE,
minDate: new Date(2018,1,1)
});
*/
var dp = Ti.UI.createPicker({
type: Ti.UI.PICKER_TYPE_DATE
});
// not working
dp.setMinDate(new Date(2018,1,1));
win.add(dp);
dp.showDatePickerDialog();
win.open();
*Observed Behaviour:*
Setting minDate on creation works, adjusting it after doesn't
*Expected behaviour*:
On Android setting minDate/maxDate on runtime (after creation) should work as it does on iOS.
*Community Credit*:
Joren Vos for finding the issue, Michael Gangolf for helping locating the problem/creating test code.
PR: https://github.com/appcelerator/titanium_mobile/pull/10000
FR Passed. PR Merged.
Closing ticket. Fix can be seen in SDK Version: 7.3.0.v20180607210411 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10000