Print Page | Close Window

Default Calendar View

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=19200
Printed Date: 11 April 2026 at 11:53pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Default Calendar View
Posted By: suedechaser
Subject: Default Calendar View
Date Posted: 09 April 2006 at 4:42am
    Hi All,

I would like to change the default Calendar view from monthly to weekly.

Where is the default view in code ? I've had a good look through calendar.asp and I cannot see much.

Can enyone help please?

Thanks in advance

Suede



Replies:
Posted By: WebWiz-Bruce
Date Posted: 10 April 2006 at 10:54am
This is not a easy task to do.

You would need to change the link at the top of the forum to point to the file 'calendar_weekly.asp instead of calendar.asp

You will also need to pass cross the month and week number in a querystring.


Posted By: wistex
Date Posted: 03 May 2006 at 12:43pm
Originally posted by -boRg- -boRg- wrote:

This is not a easy task to do.

You would need to change the link at the top of the forum to point to the file 'calendar_weekly.asp instead of calendar.asp

You will also need to pass cross the month and week number in a querystring.

Borg, there may be another way to handle calendar_weekly.asp as far as input variables go.  Instead of specifying a week number, you could instead input any date and then figure out the week's start date from there.

Example:
  1. In the URL pass a date, any date.  If none is specified, use the current date.
  2. Determine what day of the week the specified date is on (Mon., Tue, Wed., etc.).
  3. Determine what day of the week the week starts on (Mon. or Sun.).
  4. Then figure out the first day of the week based on the date passed in the URL. 
    • If the date passed is a Monday and the week starts on Monday, then set the displayed week's start date to that date.
    • If the date passed is a Tuesday and the week starts on Monday, then set the displayed week's start date to date-1.
    • If the date passed is a Wednesday and the week starts on Monday, then set the displayed week's start date to date-2.
    • Etc.
  5. If the week starts on Sunday instead of Monday, subtract an additional day.
  6. Run query showing next 7 days using the displayed week's start date figured out above.
And it would be nice if you gave us the option of chosing either Monday or Sunday for the start date of the weekly view.  Even if the monthly view started on Sunday, it would be nice if the weekly view started on the day we specified.

By using this method, it would be super simple to link to any week in the weekly calendar without knowing the week number in advance.

(Hopefully that makes sense.  I'm a bit tired.  When I am more awake, I'll come back and make sure what I said actually makes sense.) Wink


-------------
http://www.wistex.com" rel="nofollow - WisTex Solutions
http://www.caribbeanchoice.com/forums" rel="nofollow - CaribbeanChoice Forums


Posted By: WebWiz-Bruce
Date Posted: 04 May 2006 at 12:16pm
Some interesting suggestions.

The reason why the start day for the week is Sunday, is becuase Microsoft decided in VBScript that Sunday should be the first day of the week.

This is why most ASP calendar systems have Sunday as the first day, I would have liked to have Monday, but the code calculations was complex enough, trying to make Monday the first day would have really have made things difficult and very unpredictable.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: wistex
Date Posted: 04 May 2006 at 2:11pm

True, but it'd be nice to have an option to override that, especially if you are linking to the weekly calendar from outside the forum.  I understand that the weekly calendar would start on Sunday if linked from the monthly calendar, but a lot of us would like to link to the weekly calendar directly and being able to tell it to start on Monday would be nice.

If you implement it similar to how I described, then loading calendar_week.asp without any parameters would always load the current week's events.

Also another possibility is displaying the week in a rolling 7 day format (i.e. the next 7 days).  Especially when you are dealing with events, people are more concerned with what is upcoming rather than what is passed.

When we link directly to the weekly view (bypassing the monthly view), more options become available for displaying the information.  People could change the "Calendar" link to go to the weekly view or even link to it from outside the forum and display exactly what they want, not being tied to the way the Monthly view is configured.


-------------
http://www.wistex.com" rel="nofollow - WisTex Solutions
http://www.caribbeanchoice.com/forums" rel="nofollow - CaribbeanChoice Forums


Posted By: WebWiz-Bruce
Date Posted: 04 May 2006 at 3:24pm
If you link directly to the calendar_week.asp without passing any parameters it will already automatcally display the calendar for the present week.

eg:- http://forums.webwiz.net/calendar_week.asp - http://forums.webwiz.net/calendar_week.asp

If you want to display a particular week then you use the following parameters in a query string:-

M= Month number - 1 to 12
W= Month week number - 1 to 5  (this can be omitted) 2 would be secound week of the month
Y= Year - 1900 to 2030


eg:-

M=5&W=2&Y=2006


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: wistex
Date Posted: 04 May 2006 at 11:33pm
Originally posted by <font color='#0000FF'>http://forums.webwiz.net/member_profile.asp?PF=23185&FID=18</font> - suedechaser http://forums.webwiz.net/member_profile.asp?PF=23185&FID=18 - suedechaser wrote:

]I would like to change the default Calendar view from monthly to weekly.
 
Originally posted by -boRg- -boRg- wrote:

This is not a easy task to do.

You would need to change the link at the top of the forum to point to the file 'calendar_weekly.asp instead of calendar.asp

You will also need to pass cross the month and week number in a querystring.
 
Originally posted by -boRg- -boRg- wrote:

If you link directly to the calendar_week.asp without passing any parameters it will already automatcally display the calendar for the present week.

eg:- http://forums.webwiz.net/calendar_week.asp - http://forums.webwiz.net/calendar_week.asp
 
I think I misunderstood you before then.  I thought you meant that you could not change the Calendar button to go to the weekly page because the week number needed to be passed in the parameter.
 
So the answer to his question is actually yes then.  You can change the default view to be weekly instead of monthly by changing the Calendar button link, and there is no need to pass any parameters since it defaults to the current week.
 
Am I correct?
 
P.S. Being able to pass the date in the URL instead of a week number would be a lot easier for those of us integrating the calendar from outside the forum, since its easier to pass a date than figure out what week number a date belongs to.


-------------
http://www.wistex.com" rel="nofollow - WisTex Solutions
http://www.caribbeanchoice.com/forums" rel="nofollow - CaribbeanChoice Forums


Posted By: WebWiz-Bruce
Date Posted: 05 May 2006 at 10:19am
Yes you are correct, I was wrong in my first post and had forgot that I had built in error handling that would default to the present week if not date had been passed.

I shall look into the possibility of being able to pass a date to the week view page.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net