Hey all, I've been trying to figure out how to go about this problem i have encountered. I need to figure out a way to check what day was chosen on the calendar and see if anything surrounding it is un-clickable. In other words, if a date is disabled after the selected date then it can not go any farther.
Here is an example:
Say its March and March has 31 days total. The user chooses day 9. Therefore, days 1-8 are not selectable (i have already coded this part)
Now say that day 10 is not selectable since its already taken by something. In this case, the user will not be allowed to click any other date past the 9th since it can not cross over a day thats already been taken by something.
I really don't know how to check for that BUT i do have the days already in a array type that are disabled. That array would look like this:
[10,15,20]
As in the case above, i know what days are not selectable but am unsure of how to go about coding it if the user (again, per the example above) choose day 11 and that crosses over day 10 thats already not selectable.
Here is a picture of it: http://img704.imageshack.us/img704/9803/cals.jpg
Any help and ideas would be great!
Thanks, David
Ok, using ASP i have come up with a soluction to most of the problem:
sVal = tempResults 'This is the array of used dates already
tmpDate = tmpDate + 1 'This is the date they chose (9) and added a 1 making it 10 (next day)
theMonthDays = getDaysInMonth(theMonth, theYear) ' This just gets how many days are in the current selected month
ArrayOfValues = Split(sVal, ",") 'this splits the array of used dates to be checked below
For i = 0 To UBound(ArrayOfValues)
if tmpDate = CInt(ArrayOfValues(i)) then 'if it finds a date used already then block the rest
dim z, theBlockedDays
z = tmpDate
do until z = theMonthDays + 1
theBlockedDays = "'" & theMonth & "-" & z & "-" & theYear & "'," & theBlockedDays
z = z + 1
loop
exit for
end if
Next
Now that works for the day 9 but does not work if i choose day 11 since the next day is open and then day after that is opened as well. How would i go about checking for that?
David