Closed (won't fix)
Project:
Calendar
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Jul 2008 at 07:43 UTC
Updated:
9 Jan 2010 at 00:56 UTC
Hello,
Currently, when I create a calendar view, monthly view will be default view, how can I change it to default weekly view ??
Comments
Comment #1
dydecker commentedCheck 'week' in the setting for Granularity in Argument "Date: Date".
Comment #2
allentseng commentedHello dydecker,
I went to my views' argument. I saw "Date: From" and "Date: To". no "Date: Date". and there is no week settings for Granularity after added either "Date: From" or "Date: To" argument. Did I miss something ??
Comment #3
dydecker commentedOh, sorry - I just reread your request was for 5.x-2.0 not 6.2. My mistake. Perhaps someone else could help.
Comment #4
karens commentedDefaulting to the month view is hard-coded into the 5.2 version. I fixed that in the 6.2 version but haven't done it in 5.2. This is a feature request, it should be doable. I thought there was already an issue for this, but don't see it now, so I guess this will be it.
Comment #5
allentseng commentedHello Karen,
I have read source code of calendar module. find calendar.inc near line 60 says.
// If no arguments are provided, default to current month view.
if (empty($view->args) || !calendar_is_calendar_arg($view)) {
$query->calendar_type = 'month';
Try to set $query->calendar_type = 'week';
But, not work.
Are there other codes I should change ??
Basically, we need to set all calendar default view to weekly.
Comment #6
masipila commentedHi,
while waiting for the implementation of this feature request this little workaround might be useful.
When you're calendar view is set up and working, add this code to the Argument handling code section of the View:
This code simply checks if the Views arguments are empty. In this case it puts the current year to first argument and current week with W-prefix to second argument.
Edit: this makese the week view to be default. This example can be easily modified to make day view the default, just put current year, month and day to the $args array.
Hope this helps,
Markus
Comment #7
allentseng commentedwork like a charm.
thanks Markus.
Comment #8
mroswell commentedSetting back to active to retain this as a current feature request for the module
Comment #9
karens commentedI've decided I'm not going to add any new features to the D5 version. I need to finish D5 up and get an official release out on D6 and start looking at D7, so there just isn't time to make and maintain more changes to D5.
Comment #10
swortis commentedIs there a way of choosing different default views for page vs block (D6)?
Comment #11
Delta Bridges commentedHello there,
Although I know this feature will not be ported to the 5.x branch, I will need some help regarding the #6 piece of code kindly provided by masipila.
The code first seemed to work very well when I implemented it last week.
However, one week later, I just realised that the events have not been updated: still the ones from last week.
I cleaned the cache, removed the code, inserted the code again etc... still have last week events listed.
Can anybody help?
Many thanks,
DB
Comment #12
arlinsandbulte commentedAny update? Can it be marked won't fix again?
Comment #13
arlinsandbulte commentedsee #9