Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25917] Android: Allow picker minDate/maxDate properties to be set dynamically

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-07-09T23:52:35.000+0000
Affected Version/sRelease 7.1.0
Fix Version/sRelease 7.3.0
ComponentsAndroid, TiAPI
Labelsandroid, parity, picker
ReporterRene Pot
AssigneeYordan Banev
Created2018-03-30T13:15:35.000+0000
Updated2018-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.

Comments

  1. Yordan Banev 2018-04-13

    PR: https://github.com/appcelerator/titanium_mobile/pull/10000
  2. Lokesh Choudhary 2018-04-30

    FR Passed. PR Merged.
  3. Samir Mohammed 2018-06-12

    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

JSON Source