PDA

View Full Version : [CLOSED] Timefield Validation



AmitM
Oct 13, 2013, 12:39 PM
I have two timefields in a fairly typical scenario: A start time and end time:



Html.X().TimeFieldFor(m => m.MondayStartTime, false).FieldLabel("Start").MinTime(new TimeSpan(7, 30, 0)).MaxTime(new TimeSpan(18, 30, 0)),
Html.X().TimeFieldFor(m => m.MondayEndTime, false).FieldLabel("End").MinTime(new TimeSpan(7, 30, 0)).MaxTime(new TimeSpan(18, 30, 0))


How/Where can I put a validator to make sure that the end time is not before the start time?

Thanks,
Amit

Daniil
Oct 14, 2013, 5:39 AM
Hi Amit,

You can use Vtype="daterange".
http://examples2.ext.net/#/Form/DateField/From-To_Range/