Question : Week Number problem

I have the following function to produce the week number from a given date:

<CFFUNCTION NAME="GetWeekNo" RETURNTYPE="String">
  <CFARGUMENT NAME="MDate" DATATYPE="Date" REQUIRED="True">
  <CFIF Year(MDate) EQ 2012 OR Year(MDate) EQ 2017 OR Year(MDate) EQ 2023 OR
  Year(MDate) EQ 2034 OR Year(MDate) EQ 2040 OR Year(MDate) EQ 2045 OR
  Year(MDate) EQ 2051 OR Year(MDate) EQ 2062>
    <CFRETURN LZero(DatePart("ww",MDate))>
  <CFELSE>
    <CFRETURN LZero(DatePart("ww",MDate)-1)>
  </CFIF>
</CFFUNCTION>

The function works properly (the years mentioned in the function are to re-align the weeks because 01/01/year in those years produces week 00)

My boss now wants the week numbers to correspond with those in MSOutlook, with the first week of the year being the first full week.

I have tried manipulating the code in the function but I am getting in a mess!  Can someone please help me work it out?

Answer : Week Number problem

I may not be correct, but I don't see a reason to use eval at all your js.

 If you want to change the value of a select, you should use selectedIndex. This requires you know what number the option you want to select is, starting at 0. Hope this helps.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
<select id="course">
  <option value="1">course 1 - $800/option>
  <option value="2">course 1 - $900</option>
  <option value="3">course 2 - $900</option>
  <option value="4">course 2 - $1000</option>
</select>
<select id="dates">
  <option value="5/10-5/24">5/10 - 5/24</option>
  <option value="5/14-5/28">5/14 - 5/28</option>
  <option value="5/21-6/4">5/21 - 6/4</option>
</select>
<script type="text/javascript">
var course=document.getElementById('course');
var dates=document.getElementById('dates');
course.onchange=function(){
  switch(course.value){
    case 1: dates.selectedIndex=0;break;
    case 2: dates.selectedIndex=2;break;
    case 3: dates.selectedIndex=1;break;
    case 4: dates.selectedIndex=0;break;
  }
}
Random Solutions  
 
programming4us programming4us