I try tovalidate two dates (start -> end) where only the first ist required, but when the user enters the second date it must be greater than the first. I'm using the MVC Foolproof package with the "PassOnNull" parameter.
Model
<Required()> _
<DisplayName("Event Start")> _
<DataType(DataType.DateTime)> _
'This doesn't work:
Public Property EventStart As Nullable(Of DateTime)
'This does work but with the ugly default value in the textbox
Public Property EventStart As DateTime
<DisplayName("Event End")> _
<DataType(DataType.DateTime)> _
<GreaterThan("EventStart", PassOnNull:=True)> _
Public Property EventEnd As Nullable(Of DateTime)
I can get it to work with setting the EventStart date not NOT nullable but then i get a default date in the textbox with the value "01.01.0001 00:00:00" which is'nt even my country setting!
So I would like to get it to work with the nullable model propery or get rid of the "01.01.0001 00:00:00" value and have a blank textboy instead!