<p>In JavaScript, what is the best way to determine if a date provided falls within a valid range?</p>

<p>An example of this might be checking to see if the user input <code>requestedDate</code> is part of the next valid work week. Note that this is not just checking to see if one date is larger than another as a valid date would be equal to or greater than the lower end of the range while less than or equal to the upper end of the range.</p>

So if i understand currenctly, you need to look if one date is bigger than the other.
```
```
function ValidRange(date1,date2)
{
   return date2.getTime() > date1.getTime();
}
```
```
You then need to parse the strings you are getting from the UI, with Date.parse, like this:
```
```
ValidRange(Date.parse('10-10-2008'),Date.parse('11-11-2008'));
```
```
Does that help?