Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8039 Posts in 1852 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: startdate for month view  (Read 245 times)
0 Members and 1 Guest are viewing this topic.
kmcpeak
New Member
*

Karma: 0
Offline Offline

Posts: 0

Wed Developer


WWW
« on: February 02, 2005, 07:47:00 AM »

I'm trying to modify my default template file so that when users view the current month the start date for events being displayed is the current day. Below is the code I created based on my interpretation of the documentation:

if ($VIEW eq "Month" && $MONTH == $TODAY_MONTH) { &getEvents( { 'start'=>'today' } ); }
elsif ($VIEW eq "Month" && $MONTH != $TODAY_MONTH) { &getEvents( { 'range'=>'month' , 'month'=>$MONTH } ); }

But this does not work, the current month view still starts at the first of the month rather than the current day. I'm not sure why though based on the documentation below it seems like it should work. What am I missing?

thanks,
Kevin

BELOW COPIED FROM: http://www.calendarscript.com/documentation/customization.html#1.4

The logic to determine the actual begin date and end date of the range to show is:

Start Date
-If a value for 'start' is passed, use it.
-If a startdate is passed, use it.
-Construct a startdate value from the year, month, and date values passed.
-If any of these fields are not passed, use the currently displayed date's value.

End Date
-If a value for 'end' is passed, use it.
-If an enddate is passed, use it.
-If a duration is passed, add it to the start date and use that as the end date.
-If any value is passed for 'range' calculate that range from the start date, and use it.
-Default to a monthly display from the start date (it seems like based on this one my idea code should work)

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 227

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: February 02, 2005, 02:07:00 PM »

** What am I missing? **

Is there such a thing as:

&getEvents( { 'start'=>'today' } );

What is "today"? I don't see it defined anywhere in the script contrary to what the documentation says. Is it used in any other templates??

You might be better off trying to use 'startdate' as at least the value for the current date is easily retrieved with the $TODAY_DATESTRING script variable.

JMO

Dan O.

BTW. "month" IS a predefined value in the script (see the sub getEvents { routine of the calendar.pl file).

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: