Passing Dates through Querystring

Results 1 to 2 of 2

Thread: Passing Dates through Querystring

  1. #1
    Ascot Guest

    Default Passing Dates through Querystring

    &nbsp;<BR>hallo,<BR>I have a calendar displaying current month. I have buttons to go forward and back through months. These buttons append "?month=8&year=2001" or whatever to the url.<BR><BR>the page then picks this up as it reloads and displays that month.<BR>That works fine.<BR><BR>I have problem because when you view current month (July) you see the day highlighted. It works on first load of page but not when browsed forward then back. (July -&#062; view Aug -&#062; view July)<BR><BR>todayDate = Datepart ("D", Date)<BR>todayMonth = Datepart ("M", Date)<BR>todayYear = Datepart("YYYY", Date)<BR><BR>if (Request.QueryString("month") = "") then<BR> viewMonth = todayMonth<BR> viewYear = todayYear<BR> &#039;&#039;&#039;&#039;Code to highlight day<BR>elseif Request.QueryString("month") = "0" then<BR> viewMonth = 12<BR> viewYear = Request.QueryString("year") - 1<BR> <BR>elseif Request.QueryString("month") = "13" then<BR> viewMonth = 1<BR> viewYear = Request.QueryString("year") + 1<BR> <BR>else<BR> viewMonth = Request.QueryString("month")<BR> viewYear = Request.QueryString("year")<BR>end if<BR><BR>if ((viewMonth = todayMonth) and (viewYear = todayYear)) then<BR> &#039;&#039;&#039;&#039;&#039;&#039;Code to Highlight day <BR>end if<BR><BR><BR><BR>This doesn&#039;t work! Driving me insane!

  2. #2
    Join Date
    Dec 1969

    Default RE: Passing Dates through Querystring

    Learn about .net it has great calender functions :)<BR><BR>Just kidding mate. Just a thought, why not pass the entire date through the querystring then you can just do datepart("D", mydate) or something. I know you have buttons and the like to scroll dates but that isn&#039;t a part of highlighting a particualr day.<BR><BR>Another thought : if you are highlighting the day to let them know it&#039;s selected then use Javascript, saves a trip to the server and back, and you can pass the day through a hidden form field...<BR><BR><BR>Tooze

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts