Validating Date Range Produced By jQuery UI DatePicker

I am using the date picker provided by jQuery UI to select a date range that ends up in a single text input with something like 11/11/2008 - 12/05/2008. What would you recommend as far a validation (jQuery/JavaScript) on the client side as well as code for validation on the server side (ASP.NET/C#) to make sure the user enters valid dates?

Note I asked a question on Stack Overflow the other day about how to parse out the two dates using C# if your interested.

Answers


CustomValidator. Should be fairly simple to split these into two separate dates, parse each, and compare as necessary to verify the range is correct.


You can compare Dates with javascript fairly easily, just convert inputs to Date objects, and then any comparator would work. I use Date.js, as it has an excellent parser. On the backend, I would assume that you can do the same thing, the key is to convert all your objects to the same type, and one that can be compared to another.


Need Your Help

Reversing a linked list in Java, recursively

java data-structures recursion linked-list

I have been working on a Java project for a class for a while now. It is an implementation of a linked list (here called AddressList, containing simple nodes called ListNode). The catch is that