Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in date validation #970

Closed
pysailor opened this issue Mar 4, 2022 · 2 comments · Fixed by #971
Closed

Regression in date validation #970

pysailor opened this issue Mar 4, 2022 · 2 comments · Fixed by #971

Comments

@pysailor
Copy link
Contributor

pysailor commented Mar 4, 2022

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

@thet
Copy link
Member

thet commented Mar 14, 2022

Fixed in: #971
@pysailor please review in euphorie/Euphorie#350

@thet thet assigned pysailor and unassigned thet Mar 14, 2022
@pysailor
Copy link
Contributor Author

Works fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants