A Dynamic Weekly calendar
1 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Monday, April 8, 2002 04:29 AM

How to generate a dynamic weekly calendar? I want to skip forward & backward between weeks(1-52). My week starts with sunday. Advance thanks for ur help.

Re: A Dynamic Weekly calendar

Posted By:   David_Liu  
Posted On:   Monday, April 8, 2002 08:21 AM

What you are asking is more of an algorithm and not a technical issue. There are probably hundred of ways to do this.

Here is the pseudo code of what I have off the top of my head.

// "someDate" is a variable taken from the parameter
// if someDateis null then somedate is today
// else someDate is the date that is passed in.

function genWeek( someDate ) {
// get the date reference of somedate (monday, tuesday, etc)

// generate the weeks calendar base on this reference

function genPrevWeek( someDate ) {
// genWeek (somedate - 7 );

function genNextWeek( someDate ) {
// genWeek (somedate + 7 );

Did I understand your questions correctly?

About | Sitemap | Contact