Advertisement

06.10.2004 at 04:03AM PDT, ID: 21020684
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

How to start the calendare weekdy on monday instead of sunday!

Asked by MaB in Active Server Pages (ASP)

Tags: , ,

Hi all!

I think my brain just went on leave 'cause I can't figure this one out. It should be easy. I have this page rendering a month calendar. The weeks start with sunday. How do I chang the code so the weeks start with monday?

Best Regards MaB

--------------------------------------------
CODE
--------------------------------------------

<!--#include file="funktioner.asp"-->

<head>

</head>

<%
dim nDex, nMonth, nYear, dtDate

' Get the current date
dtDate = Now()

' Set the Month and Year
nMonth = Request.QueryString("nMonth")
nYear = Request.QueryString("nYear")
if nMonth = "" then nMonth = Month(dtDate)
if nYear = "" then nYear = Year(dtDate)

' Set the date to the first of the current month
dtDate = DateSerial(nYear, nMonth, 1)

DoHeader(MonthName(Month(dtDate)) & "&nbsp;&nbsp;" & nYear)
%>
<form method="get" name="DateSelect" action="calTest.asp">

<table width=251>
<tr><td><select name="nMonth" onChange="DateSelect.submit();"><%
      for nDex = 1 to 12
         Response.Write "<option value=""" & nDex & """"
         if MonthName(nDex) = MonthName(nMonth) then
            Response.Write " selected"
         end if
         Response.Write ">" & MonthName(nDex)
      next %></select>&nbsp;
   <select name="nYear" onChange="DateSelect.submit();"><%
      ' Note: I have set the year to be between 2000 and 2008
      for nDex = 2000 to 2008
         Response.Write "<option value=""" & nDex & """"
         if nDex = CInt(nYear) then Response.Write " selected"
         Response.Write ">" & nDex
      next %></select></td><td align="right">
<%      Dim prevMonth, nextMonth
      Select Case CInt(nMonth) :
      Case 1
            prevMonth = 12
            nextMonth = CInt(nMonth) +1
      Case 12
            prevMonth = CInt(nMonth) -1
            nextMonth = 1
      Case Else
            prevMonth = CInt(nMonth) -1
            nextMonth = CInt(nMonth) +1
      End Select
      %>
      <input type="button" value="&lt;&lt;" name="prevMonth" onclick="window.open('calTest.asp?nMonth=<%=prevMonth%>
      <%
      Dim prevYear
      If prevMonth=12 Then
            prevYear = nYear-1
      Else
            prevYear = nYear
      End If
      %>&nYear=<%=prevYear%>','monthCal','');"><input type="button" value="&gt;&gt;" name="nextMonth" onclick="window.open('calTest.asp?nMonth=<%=nextMonth%>
      <%
      Dim nextYear
      If nextMonth=1 Then
            nextYear = nYear+1
      Else
            nextYear = nYear
      End If
      %>&nYear=<%=nextYear%>','monthCal','');">
      </td></tr>
</form>
<tr><td colspan=2>
   <table border=0 cellpadding=0 width="224">
   <tr>
      <td width=27>&nbsp;</td>
      <th width=32>Sön</th>
      <th width=32>Mån</th>
      <th width=32>Tis</th>
      <th width=32>Ons</th>
      <th width=32>Tor</th>
      <th width=32>Fre</th>
      <th width=32>Lör</th>
   </tr>
   <tr>
      <%
      'Create weeknumber cell
      Dim wno : wno = ""
      Dim wnoCell : wnoCell = "<td width=27 valign=""top"" bgcolor=""#CECECE"">&nbsp;" & wno & "<br>&nbsp;<br></td>" & vbCrLf
     
      'First weeknumber cell
      Response.write (wnoCell)
     
      ' Add blank cells until the proper day
      for nDex = 1 to Weekday(dtDate) - 1
         Response.Write "<td width=32 bgcolor=""#c0c0c0"">&nbsp;</td>" & vbCrLf
      next

      do
         Response.Write "<td width=32 valign=""top"" bgcolor=""#ffffc0"">" & Day(dtDate) & "<br>&nbsp;<br>"
         Response.Write "</td>" & vbCrLf

            if WeekDay(dtDate) = 7 then
               Response.Write "</tr>" & vbCrLf & "<tr>" & vbCrLf & wnoCell
            end if
            dtDate = DateAdd("d", 1, dtDate)
         loop until (Month(dtDate) <> CInt(nMonth))

         ' Add blank cells to fill out the rest of the month if needed
         if Weekday(dtDate) <> 1 then
            for nDex = Weekday(dtDate) to 7
               Response.Write "<td width=32 bgcolor=""#C0C0C0"">&nbsp;</td>"
            next
         end if
         %>
      </tr>
   </table>
   
<%
DoFooter("Home")
%>

-----------------------------------------
END CODE
-----------------------------------------Start Free Trial
 
Loading Advertisement...
 
[+][-]06.10.2004 at 04:46AM PDT, ID: 11278199

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 04:47AM PDT, ID: 11278204

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 05:05AM PDT, ID: 11278338

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 05:13AM PDT, ID: 11278418

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 05:19AM PDT, ID: 11278462

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: dateadd, monthcal, onchange
Sign Up Now!
Solution Provided By: huji
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.10.2004 at 05:23AM PDT, ID: 11278503

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 05:24AM PDT, ID: 11278522

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 05:35AM PDT, ID: 11278612

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 05:38AM PDT, ID: 11278652

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 05:50AM PDT, ID: 11278779

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 05:52AM PDT, ID: 11278800

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 05:55AM PDT, ID: 11278824

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 05:58AM PDT, ID: 11278850

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 06:02AM PDT, ID: 11278889

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2004 at 06:05AM PDT, ID: 11278926

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32