Skip to content

Before/after date validation should not trigger on empty dates #711

@pysailor

Description

@pysailor

Use case:
I have 2 date fields in a form, a start and an end date. pat-valdiation is used to make sure that the start date comes before the end date. (The start date validates for "not after end" and the end date validates for "not before start")
The end date is not a required field. The user should be allowed to enter only a start date.

But in such a case, the validation fails for the end date: "This date must be on or after the start date". I think in the case of a "None" date, the before/after validation should not kick in.

This can be reproduced with the given example on the pattern: https://patternslib.com/validation

It seems that an attempt to resolve this has already be done, according to this comment.
https://github.com/Patternslib/Patterns/blob/master/src/pat/validation/validation.js#L118
But apparently that is not working.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions