Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-33807

DateValidator class (mx.validators.DateValidator) incorrectly validating date

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Apache Flex 4.10.0
    • Apache Flex 4.11.0
    • None
    • Windows 7 64bit Professional (SP1) running on MacBook Pro Mid 2010 with OSX 10.8.5 Bootcamp.
      FlashBuilder 4.7 Standard
      Apache Flex 4.10
      AIR 3.8
      Flash Player 11.8

    Description

      The DateValidator class keeps returning an error on validation although the date being validated is correct according to the format provided.

      The date I am using is 19530621

      Here is the code snippet
      var strDate:String = "19530621";
      var result: String = null;
      var resultArray: Array = null;
      var validator:DateValidator = new DateValidator();
      validator.inputFormat="YYYYMMDD";

      resultArray = DateValidator.validateDate(validator, strDate, "");

      if (resultArray.length == 0)
      result = ""; // no problems
      else

      { var vr: ValidationResult = resultArray[0] as ValidationResult; result = vr.errorMessage; }

      The error returned in the result array at position 0 is below

      errorCode "wrongLength"
      errorMessage "Type the date in the format. YYYYMMDD"
      isError true
      subField ""

      The same code works as it should (passing validation) on SDK 4.9.

      I have tried a number of different dates some incorrect and others correct but the same error is returned everytime.

      I hope this is enough information to fix this bug.

      Thanks

      Attachments

        Activity

          People

            jmclean Justin Mclean
            dRa Dylan Randall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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