Hi All,
I modified the "Calandar at a glance" to make an week form.
So far, this form is working fine but I have the problem which is If I entered the date of Sunday (7/15/12), the start date with 7/22.
How do I fix this problem?
I modified the "Calandar at a glance" to make an week form.
Code:
'added calling variable as explit dim week as n dim j as n dim dayhdr_tmp as c dim dyalist_tmp as c with vars monthname=cmonth(start_day)+" "+cyear(start_day) mnth=month(start_day) curr_month=cmonth(start_day) curr_year=cyear(start_day) vWeekno = week(start_day) vYearNo = year(start_day) vWeekYear = week(start_day)+" "+year(start_day) '// Reset the Start_day by Sunday dim vBegin as d if day(start_day)>1 then 'day of the month vBegin = start_day-day(start_day)+1 end if [COLOR="#FF0000"] if dow(start_day)>1 then '// day of the week, Start Sunday=1 of week vBegin = start_day-(dow(start_day)+1) else [COLOR="#0000FF"] 'if dow(start_day)=1[/COLOR] vBegin = Start_day end if[/COLOR] 'start_day = start_day+IF(dow(start_day)=1,0,7-dow(start_day)) dim dd as d for week= 0 to 1 ' rows of calendar for day= 1 to 7 ' columns (days of week) dd = vBegin+day+week*1 'dd = start_day+day+((week-1)*7) dayhdr_tmp="{J=L}{B="+if(week(dd)= vWeekNo,"Green","Blue White")+",Blue}"+\ day(dd)+"{T=2}|"+cdate(dd)+crlf() daylist_tmp="daylist"+week+dow(dd)+\ "=dayhdr_tmp+Sub_get_day_list("+quote(dtoc(dd))+","+quote(vEmpId)+")" evaluate_template(daylist_tmp) next next end with
How do I fix this problem?
Comment