views:

31

answers:

1

hello all,

in my page there is an option to create new date field input box. User can create as many as possible date TO and Date From box as per his need. like,

date_to1 || date_from1
date_to2 || date_from2
date_to3 || date_from3
date_to4 || date_from4

My problem is to validate all the date fields to check there is no clash in those, means the combination of the dates should not crossed with each other combination.

Thank you in advance.

+2  A: 

If you sort them by starting date (or add the restriction that they should be entered in order by the user) then you can just check that each end date is earlier than the next start date.

Bill the Lizard