Skip to content

Date validator #92

Open
Open

Description

@PowerKiKi

A date validator to which we give a DateAdapter and that validate that whatever we give is either a valid string representation of a date, or a Date. So basically forwarding to DateAdapter.isValid.

It should be used used pretty much for every datepicker in all our projects.

Usage is something like:

constructor(
    dateAdapter: DateAdapter,
) {
    const formControl = new FormControl(null, [date(dateAdapter)]);
}

Activity

  1. PowerKiKi commented on Dec 15, 2020

    @PowerKiKi
    MemberAuthor

    Pseudo-code

    function date(dateAadapter) : ValidatorFn {
        return (fromControl)=> { dateAdapter.isValid(formControl.value); }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions