cvs: pear /Date/Date Calc.php

From: Date: Wed, 20 Nov 2002 16:43:13 +0000
Subject: cvs: pear /Date/Date Calc.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-7506@lists.php.net to get a copy of this message
mohrt Wed Nov 20 11:43:13 2002 EDT Modified files: /pear/Date/Date Calc.php Log: fixed bug when century ends in 00, only define DATE_CALC_BEGIN_WEEKDAY if not already defined. Index: pear/Date/Date/Calc.php diff -u pear/Date/Date/Calc.php:1.3 pear/Date/Date/Calc.php:1.4 --- pear/Date/Date/Calc.php:1.3 Tue Nov 12 13:11:09 2002 +++ pear/Date/Date/Calc.php Wed Nov 20 11:43:12 2002 @@ -3,7 +3,9 @@ // The constant telling us what day starts the week. Monday (1) is the // international standard. Redefine this to 0 if you want weeks to // begin on Sunday. +if(!defined('DATE_CALC_BEGIN_WEEKDAY')) { define('DATE_CALC_BEGIN_WEEKDAY', 1); +} /** * Date_Calc is a calendar class used to calculate and @@ -20,11 +22,11 @@ * obtain it through the world-wide-web, please send a note to * license@php.net so we can mail you a copy immediately. * - * Copyright (c) 1999, 2000 ispi + * Copyright (c) 1999, 2002 ispi * * @access public * - * @version 1.2.4 + * @version 1.2.6 * @author Monte Ohrt <monte@ispi.net> */ @@ -1209,8 +1211,8 @@ function dateToDays($day,$month,$year) { - $century = substr($year,0,2); - $year = substr($year,2,2); + $century = (int) substr($year,0,2); + $year = (int) substr($year,2,2); if($month > 2) { $month -= 3; @@ -1624,4 +1626,4 @@ } // end class Date_calendar -?> \ No newline at end of file +?>

« previous php.pear.cvs (#7506) next »