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

Add moment date format support #408

Open
juaal12 opened this issue Sep 24, 2020 · 0 comments
Open

Add moment date format support #408

juaal12 opened this issue Sep 24, 2020 · 0 comments
Labels

Comments

@juaal12
Copy link

juaal12 commented Sep 24, 2020

Description

Add moment js date format support.

Describe the solution you'd like

At minDate validator, accept as parameter a moment date format. Then in date checker/date parser, parse this moment format into a valid date format. Finally use this returned date object for executing date comparison. in minDate validator function.

Something like:

    if (obj._d instanceof Date) {
      const d = obj._d as Date;
      const month = +d.getMonth() + 1;
      const day = +d.getDate();
      return `${d.getFullYear()}-${formatDayOrMonth(month)}-${formatDayOrMonth(day)}`;
    }
@ajayojha ajayojha added the rxweb label Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants