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

Angular Formly with dynamic custom datetime field is not showing validation message on form submit #3908

Open
sohaibameenvivup opened this issue May 7, 2024 · 0 comments
Labels

Comments

@sohaibameenvivup
Copy link

`ngOnInit(): void {
this.setFields();
}

private setFields() {
this.fields = [
{
key: "dateOfBirth",
type: "custom-date",
templateOptions: {
label: "FamilyPay.CreateHolidayClubOrder.EmployeeBirthDate",
type: "date",
minAge: this.model.dateOfBirth ? null : 18,
maxAge: this.model.dateOfBirth ? null : 80,
translate: true,
disabled: !!this.model.dateOfBirth,
required: true,
},
},
];
}

`

Datetime validation is working with Min and Max range but I want to add another validation which validates the date when no value for datetime is selected so It should show a regular message "Date of birth is required"

That would be great if somebody can suggest something on it. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant