This topic is locked

Availability Calendar

4/6/2009 5:53:59 PM
ASPRunnerPro General questions
jtksmith author

I have been trying to use the Vacation Template to create an Availabilty Calendar but have been getting unexpected results. I created two additional tables in the database "Members" and "Availability". I populated them with some demo information and then tried to duplicate the "vacreservationscalendar" that exists in the template. I can get the Availability Calendar to display without an ASP Error but it will not show the Booked or Unavailable dates as it should. If there are booked dates, it diplays as in this image.


If there are no booked dates, it displays the calendar fine.


I've tried changing the format of the dates and other things but I can't get it to work properly. What is the secret to making this work? I'm sure I'll need to change either the page in the Visual Editor or the code in the Events but I've tried and can't figure out the secret to it.
I've uploaded the project to the following demo account: Availability Calendar
Click on 'Members' then 'Availability'.
Your assistance will be greatly appreciated. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=11491&image=3&table=forumtopics' class='bbc_emoticon' alt=':rolleyes:' />

J
Jane 4/8/2009

Jeremy,
Vacation template is based on old templates (used in ASPRunnerPro 5.2).

You've created your pages using new templates.

Try to change your code in the ListOnLoad event in the following way:

if year(rsb("FromDate"))=tYear and month(rsb("FromDate"))=tMonth and j=day(rsb("FromDate")) then flag=1

if year(rsb("ToDate"))=tYear and month(rsb("ToDate"))=tMonth and j=day(rsb("ToDate")) then flag=0

if flag=1 then

xt.assign "row00" & j+wd & "Day" & i & "Year_Reserve_value","bgcolor=red"

else

xt.assign "row00" & j+wd & "Day" & i & "Year_Reserve_value","bgcolor=white"

end if

rsb.MoveNext

jtksmith author 4/8/2009

Jane,
I'm not sure if I caused this with the template versions or not or if I even could have. If there is something I should do to prevent old templates from being used, please let me know. Regarding your advice, it was PERFECT!!!! I did exactly as you said and the problem was fixed. Thank you. I'm really impressed with this program and the help from experts such as yourself.