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


Login with username, password and session length

Search

 
Advanced search

8054 Posts in 1860 Topics- by 2099 Members - Latest Member: roi
Pages: 1 [2]   Go Down
Print
Author Topic: Month Wrap  (Read 818 times)
0 Members and 1 Guest are viewing this topic.
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 235

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


WWW
« Reply #15 on: April 14, 2004, 09:28:00 PM »

Glad to hear you can make use of it.

Dan O.

[This message has been edited by DanO (edited April 14, 2004).]

Logged
mraj
New Member
*

Karma: 0
Offline Offline

Posts: 0

Software Engineer


« Reply #16 on: March 03, 2005, 10:03:00 PM »

Two posts up, use this instead:

<TD CLASS="thinborder" VALIGN='top' width='14%' <%=$rowheight%> BGCOLOR="<%IF SELECTED%><%=$_GRID_CELL_SELECTED_BGCOLOR%><%ELSE%><%if($DAY->{'mm'}==$TODAY_MONTH){ print $_GRID_CELL_BGCOLOR } else { print $_GRID_DATE_BGCOLOR }%><%/IF%>">

Then if you view, say, 3-weeks, and then move back a week, it will highlight properly.

------------------
See some of my modifications to CalendarScript at
http://www.prayforoneanother.org/cgi-bin/cal/calendar.pl

Logged

See some of my modifications to CalendarScript at
http://www.prayforoneanother.org/cgi-bin/cal/calendar.pl
mraj
New Member
*

Karma: 0
Offline Offline

Posts: 0

Software Engineer


« Reply #17 on: March 24, 2005, 11:27:00 PM »

Another tweak:

This line:
($end_ss,$end_mi,$end_hh,$end_dd,$end_mm,$end_yy,$end_wd,$end_yd,$end_isdst) = localtime($end);

can be replaced with this line:
$end_wd = (localtime($end))[6];

------------------
See some of my modifications to CalendarScript at
http://www.prayforoneanother.org/cgi-bin/cal/calendar.pl

Logged

See some of my modifications to CalendarScript at
http://www.prayforoneanother.org/cgi-bin/cal/calendar.pl
mraj
New Member
*

Karma: 0
Offline Offline

Posts: 0

Software Engineer


« Reply #18 on: March 24, 2005, 11:54:00 PM »

One problem I found with these changes... when you go to the "edit/delete events" page, you'll get the month wrap affect too, which is probably not what you want.

Here are the changes needed to NOT get month wrap on the "edit/delet events" page:

The end of Date.inc should be changed to:
   $end   = Time::Local::timegm(0,0,0,1,$start_mm,$start_yy)-1;

   if(! defined $properties->{nowrap}) {
      # Dan hack to fill out the month
      if ($week_start_day <= $start_wd){
         my $dooffset = (7-(7-$start_wd)-$week_start_day) * 60 * 60 * 24;
         $start -= $dooffset;
      } else {
         $dooffset = (7-$week_start_day) * 60 * 60 * 24;
         $start -= $dooffset;
      }
      $end_wd = (localtime($end))[6];
      if ($end_wd >= $week_start_day){
         $dooffset = (6 + $week_start_day - $end_wd) * 60 * 60 * 24;
         $end += $dooffset;
      }
   }
   return ($start,$end);
   }
1;

Event.inc (around line 104):
($start,$end) = &Date::getTimeSpan( {'range'=>'month','startdate'=>$datestring,nowrap=>defined $properties->{nowrap} } );

edit_delete_events.html (around line 174):
else {
   $properties->{range} = 'month';
   $properties->{month} = $month;
   $properties->{year} = $year;
   $properties->{nowrap} = 1;
   $events = &Event::getEvents($events_db,$schedule_db,$properties);
   }

For all of the above, the lines with "nowrap" are the ones I had to add on top of the other month wrap changes.

------------------
See some of my modifications to CalendarScript at  http://www.prayforoneanother.org/cgi-bin/cal/calendar.pl

[This message has been edited by mraj (edited March 24, 2005).]

Logged

See some of my modifications to CalendarScript at
http://www.prayforoneanother.org/cgi-bin/cal/calendar.pl
Pages: 1 [2]   Go Up
Print
Jump to: