Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    MiniDateRangeItem and validation

    SmartClient Version: v13.1p_2025-02-07/AllModules Development Only (built 2025-02-07)

    Hello, I'm trying out the MiniDateRangeItem, but I'm unsure about its validation behaviour.
    1. If I select a valid range and call validate() on the form, the validation fails with the message "must be a date".
    2. If I call validate() on the form item, it returns true for both valid and invalid ranges (e.g., from tomorrow to yesterday).
    3. With autoValidate: true, I expected that selecting an invalid range wouldn't even be possible.
    Could you clarify how validation is supposed to work for the MiniDateRangeItem?

    Code:
    isc.DynamicForm.create({
        ID: "dateForm",
        width: 620,
        colWidths: [190, "*"],
        fields : [
        {
            name: "mdri", title: "Mini Date Range", autoValidate:true,
            editorType: "MiniDateRangeItem"
        }
        ]
    });

    #2
    hi Claudio - MDRI doesn't produce a date, so it shouldn't have a date-validator. This was a recent regression caused by some logic being moved from MDRI to DateRangeItem, to fix the same issue there, but the logic is required in both classes. It's been reinstated in MDRI for today's builds, dated February 11, and later ones.

    Comment


      #3
      SmartClient Version: v13.1p_2025-02-11/AllModules Development Only (built 2025-02-11)

      Hello, I see the fix for point #1, thanks.

      About #3, maybe it's just meant to validate the two individual values, rather than the date range?

      Comment


        #4
        hi Claudio - your point 3 is correct - we've fixed so that range-validation fails if the toDate is before the fromDate - the toDate field gets the error and shows the invalidRangeErrorMessage as expected.

        Please retest with a build dated February 19 or later.

        Comment


          #5
          SmartClient Version: v13.1p_2025-03-01/AllModules Development Only (built 2025-03-01)

          I see it's fixed, thank you very much

          Comment


            #6
            SmartClient Version: v13.1p_2025-03-07/AllModules Development Only (built 2025-03-07)

            Hello, I noticed that there's still a problem, with this test case:

            Code:
            isc.DynamicForm.create({
                ID: "dateForm",
                width: 620,
                colWidths: [190, "*"],
                fields : [
                {
                    name: "mdri", title: "Mini Date Range", autoValidate:true,
                    editorType: "MiniDateRangeItem"
                }
                ]
            });
            if you try to select the same day for start and end using the date chooser, you'll get an error:

            Click image for larger version

Name:	2025-03-07 22.21.26.jpg
Views:	19
Size:	30.1 KB
ID:	275343

            this doesn't happen if you use the relative shortcuts

            Comment


              #7
              Thanks Claudio - we had a toDate > fromDate check, which should have been >=. It's been fixed for today's builds, dated March 8 and later.

              Comment


                #8
                SmartClient Version: v13.1p_2025-03-08/AllModules Development Only (built 2025-03-08)

                I can confirm that it's working now, thank you very much

                Comment

                Working...
                X