-1

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.

1
  • To be clear, what you want to validate is that no date range overlaps any other date range? Commented Aug 6, 2010 at 12:30

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.