Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-83348

Date Picker Issue in Predefined Value field of the Form

    Details

    • What problem did the customer find?:
      Date Picker stops rendering the Calendar.
    • What do you think is the root cause? (if known):
      The _valueExtractorFn function doesn't predict that long numbers return the value "Invalid Date" instead of "false" when date parsing.
    • Proposed solution (if any):
      Hide
      I believe that should have a validation for invalid dates on this line: https://github.com/liferay/alloy-ui/blob/5b4ad2a8d5cb3ab362979e4fb470fcf1eea5ba39/src/aui-datepicker/js/aui-datepicker-delegate.js#L376
      When you set a long number (not supported by A.Date.parse), the value "Invalid Date" is returned by parse function instead of just "false", thus the returned value is not filtered from the array of dates forward in the code.
      Show
      I believe that should have a validation for invalid dates on this line: https://github.com/liferay/alloy-ui/blob/5b4ad2a8d5cb3ab362979e4fb470fcf1eea5ba39/src/aui-datepicker/js/aui-datepicker-delegate.js#L376 When you set a long number (not supported by A.Date.parse), the value "Invalid Date" is returned by parse function instead of just "false", thus the returned value is not filtered from the array of dates forward in the code.

      Description

      Steps to reproduce:

      1. Login as admin user, Navigate to Site > Content > Forms > click on + icon (New Form);
      2. Add Date Field then click on Show More Options;
      3. Enter invalid date eg:02/04/20182222222 in Predefined Value and click outside the field;
      4. Assert that Predefined Value field displays "Invalid Date";
      5. Click again on the Predefined Value field.

      Actual Behavior:
      Date Picker displays blank and the user is not able to select date.

      Expected behavior:
      Date picker should display the calendar to select a different date.

      Reproduced on:
      7.0.x @ commit 5cfa453beb301da575555aa8946c918f619c32b0

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 12 weeks, 4 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP57
                  7.0.0 DXP SP9
                  7.0.X
                  7.1.X
                  Master