phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: calendar/inc class.uicalendar.inc.php,1.66.2.29,


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: calendar/inc class.uicalendar.inc.php,1.66.2.29,1.66.2.30
Date: Tue, 29 Oct 2002 08:09:19 -0500

Update of /cvsroot/phpgroupware/calendar/inc
In directory subversions:/tmp/cvs-serv27294

Modified Files:
      Tag: Version-0_9_14-branch
        class.uicalendar.inc.php 
Log Message:
fix for planner and php < 4.1
date('W',...) which planner uses to get the week-of-year is php 4.1
added a replacement (not shure if it generates the correct ISO week-of-year for 
all year, but its ok for the next 3-years :-) )


Index: class.uicalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.uicalendar.inc.php,v
retrieving revision 1.66.2.29
retrieving revision 1.66.2.30
diff -C2 -r1.66.2.29 -r1.66.2.30
*** class.uicalendar.inc.php    28 Oct 2002 19:03:58 -0000      1.66.2.29
--- class.uicalendar.inc.php    29 Oct 2002 13:09:17 -0000      1.66.2.30
***************
*** 1411,1414 ****
--- 1411,1418 ----
                                        $d      = 
mktime(0,0,0,$this->bo->month,1,$this->bo->year);
                                        $w      = date(\'W\', $d);
+                                       if ($w == \'W\')        // php < 4.1
+                                       {
+                                               $w = 1 + intval(date(\'z\',$d) 
/ 7);    // a bit simplistic
+                                       }
                                        $offset = (7-date("w", $d)+1)%7;
                                        $offset = $offset == 0 ? 7 : $offset;
***************
*** 1429,1432 ****
--- 1433,1440 ----
                                                $d += 604800; // 7 days whith 
24 hours (1h == 3600 seconds) each
                                                $w = date(\'W\', $d);
+                                               if ($w == \'W\')        // php 
< 4.1
+                                               {
+                                                       $w = 1 + 
intval(date(\'z\',$d) / 7);    // a bit simplistic
+                                               }
                                                $w += (isset($hdr[1][$w]))?1:0; 
// bug in "date(\'W\')" ?
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]