Web Wiz - Green Windows Web Hosting - Celebrating 25 Years!

  New Posts New Posts RSS Feed - Default Calendar View
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Default Calendar View

 Post Reply Post Reply
Author
suedechaser View Drop Down
Groupie
Groupie


Joined: 25 February 2006
Location: USA
Status: Offline
Points: 129
Post Options Post Options   Thanks (0) Thanks(0)   Quote suedechaser Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
wistex View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 30 August 2003
Location: United States
Status: Offline
Points: 877
Post Options Post Options   Thanks (0) Thanks(0)   Quote wistex Quote  Post ReplyReply Direct Link To This Post 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


Edited by wistex - 03 May 2006 at 12:45pm
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
wistex View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 30 August 2003
Location: United States
Status: Offline
Points: 877
Post Options Post Options   Thanks (0) Thanks(0)   Quote wistex Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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

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


Edited by -boRg- - 04 May 2006 at 3:25pm
Back to Top
wistex View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 30 August 2003
Location: United States
Status: Offline
Points: 877
Post Options Post Options   Thanks (0) Thanks(0)   Quote wistex Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2006 at 11:33pm
Originally posted by <a href=http://forums.webwiz.net/member_profile.asp?PF=23185&FID=18 target=_blank>suedechaser</A> 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
 
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.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.