| Author |
Topic Search Topic Options
|
suedechaser
Groupie
Joined: 25 February 2006
Location: USA
Status: Offline
Points: 129
|
Post Options
Thanks(0)
Quote Reply
Topic: Default Calendar View 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
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
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.
|
 |
wistex
Mod Builder Group
Joined: 30 August 2003
Location: United States
Status: Offline
Points: 877
|
Post Options
Thanks(0)
Quote Reply
Posted: 03 May 2006 at 12:43pm |
-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:
- In the URL pass a date, any date. If none is specified, use the current date.
- Determine what day of the week the specified date is on (Mon., Tue, Wed., etc.).
- Determine what day of the week the week starts on (Mon. or Sun.).
- 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.
- If the week starts on Sunday instead of Monday, subtract an additional day.
- 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.) 
Edited by wistex - 03 May 2006 at 12:45pm
|
|
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
wistex
Mod Builder Group
Joined: 30 August 2003
Location: United States
Status: Offline
Points: 877
|
Post Options
Thanks(0)
Quote Reply
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.
Edited by wistex - 04 May 2006 at 2:17pm
|
|
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
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.aspIf 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
Edited by -boRg- - 04 May 2006 at 3:25pm
|
|
|
 |
wistex
Mod Builder Group
Joined: 30 August 2003
Location: United States
Status: Offline
Points: 877
|
Post Options
Thanks(0)
Quote Reply
Posted: 04 May 2006 at 11:33pm |
suedechaser wrote:
I would like to change the default Calendar view from monthly to weekly. |
-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. |
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.
|
|
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |