Skip to content

Regression in date validation #970

@pysailor

Description

@pysailor

Scenario: We have 2 date fields, start and end. Start must be before end, and end must be after start.

              <input class="pat-date-picker"
                     id="solution-planning-start"
                     name="measure.planning_start:records"
                     type="date"
                     data-pat-date-picker="output-format: D MMM YYYY; locale: de; week-numbers: show;"
                     data-pat-validation="not-after: #solution-planning-end; "
              />

              <input class="pat-date-picker"
                     id="solution-planning-end"
                     name="measure.planning_end:records"
                     type="date"
                     data-pat-date-picker="output-format: D MMM YYYY; locale: de; week-numbers: show;"
                     data-pat-validation="not-before: #solution-planning-start"
              />

In previous versions of pat-validation, if the condition "start must be before end" was not met, both fields were marked is invalid.

Screenshot 2022-03-04 at 13 06 09

It was possible to correct the error in either of the fields. Either by moving start before end, or by moving end after start. The validation error was cleared from both fields (and the form in general).

Screenshot 2022-03-04 at 13 06 54

With the current bundle, the mutual dependency is lost. The validation error only applies to the field that was last changed (start in this case).
Screenshot 2022-03-04 at 13 12 46
Fixing the wrong date in the other field has no effect on the validation error.

Screenshot 2022-03-04 at 13 12 56

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions