Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28442] Android: maxDate is not respected when value of picker is set higher than maxDate

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2021-05-10T15:52:26.000+0000
Affected Version/sRelease 10.0.0
Fix Version/sRelease 10.0.0
ComponentsAndroid
Labelsandroid, date, picker, regression
ReporterLokesh Choudhary
AssigneeJoshua Quick
Created2021-05-07T18:08:18.000+0000
Updated2021-05-10T15:52:26.000+0000

Description

Steps to reproduce:

1. Use the below code in the app.js:
var win = Ti.UI.createWindow();

var pickerDate = Ti.UI.createPicker({
    type: Ti.UI.PICKER_TYPE_DATE
});

var pickDateBtn = Ti.UI.createButton({
    title: 'Click!',
    height: 200,
    width: 250,
    top: 50,
    left: 50
});

pickDateBtn.addEventListener('click', function() {
    pickerDate.showDatePickerDialog({
        minDate: new Date(2009, 0, 1),
        maxDate: new Date(2015, 11, 31),
        value: new Date(2018, 0, 1), //check to see if the value can be set higher than maxDate, should not actually see this value in the app
        callback: function(e) {
            if (e.cancel) {
                Ti.API.info('User canceled dialog');
            } else {
                Ti.API.info('User selected date: ' + e.value);
            }
        }
    });
});

win.add(pickDateBtn);
win.open();
2. Build for Android device/emulator. 3. After the app is launched tap on click to bring up the calender. 4. Check the date showing in the calendar. h5Actual result: 1. The date is the date set for the value property of the picker.

Expected result:

1. The date showing on the calendar should be the maxDate.

Comments

  1. Joshua Quick 2021-05-07

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12787
  2. Christopher Williams 2021-05-10

    merged to master, backport PR for 10_0_X merged for 10.0.0 GA target

JSON Source