[geeklog-cvs] geeklog-1.3/system/classes calendar.class.php,1.4,1.5

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Mon Jul 26 10:32:46 EDT 2004


Update of /var/cvs/geeklog-1.3/system/classes
In directory www:/tmp/cvs-serv21007/system/classes

Modified Files:
	calendar.class.php 
Log Message:
The start of the week in the calendar can now be configured to be either Sunday or Monday (based on a patch by bond_anton).


Index: calendar.class.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/system/classes/calendar.class.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** calendar.class.php	13 May 2002 19:18:27 -0000	1.4
--- calendar.class.php	26 Jul 2004 14:32:43 -0000	1.5
***************
*** 6,16 ****
  // +---------------------------------------------------------------------------+
  // | calendar.class.php                                                        |
- // | Geeklog calendar library.                                                 |
  // |                                                                           |
  // +---------------------------------------------------------------------------+
  // | Much of this code is from Jim Wright jdlwright at yahoo.com with minor       |
  // | customizations.                                                           |
  // |                                                                           |
! // | Copyright (C) 2000,2001 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs       - tony at tonybibbs.com                            |
--- 6,16 ----
  // +---------------------------------------------------------------------------+
  // | calendar.class.php                                                        |
  // |                                                                           |
+ // | Geeklog calendar library.                                                 |
  // +---------------------------------------------------------------------------+
  // | Much of this code is from Jim Wright jdlwright at yahoo.com with minor       |
  // | customizations.                                                           |
  // |                                                                           |
! // | Copyright (C) 2000-2004 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs       - tony at tonybibbs.com                            |
***************
*** 36,50 ****
  
  /**
! * This file contains the two classes used to help support the calendar pages.  Please
! * note that our calendar code is in shambles and is hard to understand.  Not so much this file
! * as calendar.php and calendar_event.php.  Those files along with these class need
! * to be reworked to be easier to maintain and support rich calendaring features
  *
! * @auther   Tony Bibbs  <tony at tonybibbs.com>
  */
  
  /**
! * This class represents the logical structure of a calendar day and is used by the greater
! * calendar class
  *
  */
--- 36,51 ----
  
  /**
! * This file contains the two classes used to help support the calendar pages.
! * Please note that our calendar code is in shambles and is hard to understand.
! * Not so much this file as calendar.php and calendar_event.php.  Those files
! * along with this class need to be reworked to be easier to maintain and
! * support rich calendaring features
  *
! * @author   Tony Bibbs  <tony at tonybibbs.com>
  */
  
  /**
! * This class represents the logical structure of a calendar day and is used by
! * the greater calendar class
  *
  */
***************
*** 122,125 ****
--- 123,130 ----
      * @access private
      */
+     var $_week_start;
+     /**
+     * @access private
+     */
      var $_default_year;
      /**
***************
*** 175,184 ****
      function getDayOfWeek($day = 1, $month = 1, $year = '')
      {
! 	if (empty($year)) {
              $year = $this->_default_year;
          }
  
          $dateArray = getdate(mktime(0,0,0,$month,$day,$year));
!         return $dateArray['wday'];
      }
  
--- 180,193 ----
      function getDayOfWeek($day = 1, $month = 1, $year = '')
      {
! 	    if (empty($year)) {
              $year = $this->_default_year;
          }
  
          $dateArray = getdate(mktime(0,0,0,$month,$day,$year));
!         $result = $dateArray['wday'];
!         if ($this->_week_start == 'Mon') {
!             $result = ($result == 0) ? 6 : $result - 1;
!         }
!         return $result;
      }
  
***************
*** 299,302 ****
--- 308,318 ----
      */
      function getDayName($day = 1) {
+         if ($this->_week_start == 'Mon') {
+             if ($day == 7) {
+                 return $this->_lang_days['sunday'];
+             } else {
+                 $day += 1;
+             }
+         }
          switch ($day - 1) {
          case 0:
***************
*** 409,413 ****
      *
      */
!     function setLanguage($lang_days='', $lang_months='') 
      {
          if (empty($lang_days)) {
--- 425,429 ----
      *
      */
!     function setLanguage($lang_days='', $lang_months='', $week_start='Sun')
      {
          if (empty($lang_days)) {
***************
*** 439,442 ****
--- 455,463 ----
              $this->_lang_months = $lang_months;
          }
+         if ($week_start != 'Mon') {
+             $this->_week_start = 'Sun';
+         } else {
+             $this->_week_start = $week_start;
+         }
      }
      
***************
*** 503,505 ****
  }
  
! ?>
\ No newline at end of file
--- 524,526 ----
  }
  
! ?>




More information about the geeklog-cvs mailing list