Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8177

jQuery Date Widget allows you to type in invalid values

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.1, 4.0.1
    • Fix Version/s: 3.4.3, 4.0.3
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      Recent changes to the jquery Calendar date select mean that users can now type values in the text field. This is a useful change. However, the following issues need to be fixed:

      1. If you leave a required date field empty, the record is saved with current date or current date time. In this case, the 'required field' form rule should be fired.
      To recreate:

      • New Activity
      • Move cursor into Activity Date field and clear the field content
      • Save the activity. Activity Date is set to current date

      2. If you type in invalid date string into the text input field, the record is saved using current date value. In this case, an "Invalid date ... " form rule error should be fired.

      To recreate:

      • New Activity
      • Move cursor into Activity Date text field and type: 35/35/35 (or some other invalid combination of digits and forward slashes)
      • Save the activity. Activity Date is set to current date

      NOTE: I did some testing w/ alternate Date Input formats and the widget handles that quite nicely. For example, if I change my Date settings to use yyyy-mm-dd for input date format, it will only allow me to type digits and dashes. With the default mm/dd/yyy, it only allows me to type digits and forward slashes.

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2 hours
                2h
                Remaining:
                Remaining Estimate - 2 hours
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified