Why is an optional DatePicker being validated?

0 Answers 40 Views
Date/Time Pickers DateInput
Jordan
Top achievements
Rank 1
Iron
Jordan asked on 10 Apr 2023, 04:24 PM

How can we make sure optional field is not validated?  Also the model is a DateTime? type.

 


                                    i.Add()
                                        .Field(x=>x.ProductionDate)
                                        .Label(l => l.Text(Extensions.GetPropertyDisplayName<Detail_InfoForm_ViewModel>(x => x.ProductionDate)).Optional(true))
                                        .Editor(e => e.DatePicker()
                                            .HtmlAttributes(new { style = "width: 100%", title = "Production date" })
                                            .DateInput()
                                        );

No answers yet. Maybe you can help?

Tags
Date/Time Pickers DateInput
Asked by
Jordan
Top achievements
Rank 1
Iron
Share this question
or