Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28442

Android: maxDate is not respected when value of picker is set higher than maxDate

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 10.0.0
    • Fix Version/s: Release 10.0.0
    • Component/s: Android
    • Environment:
    • Story Points:
      3

      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.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              lchoudhary Lokesh Choudhary
              Reviewer:
              Gary Mathews
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration