PHP Classes

Error on days

Recommend this page to a friend!

      Gantt Chart Class  >  All threads  >  Error on days  >  (Un) Subscribe thread alerts  
Subject:Error on days
Summary:Days on months are wrong
Messages:3
Author:pepe
Date:2007-10-30 10:43:16
Update:2008-04-03 01:09:41
 

  1. Error on days   Reply   Report abuse  
Picture of pepe pepe - 2007-10-30 10:43:16
Depending on what days you use for your tasks, the number of days per month are wrong. Sometimes October has 2 "day 28" or November ends at "day 29". Try modifing your example "baseline_only.php" starting project: 1-Sep and end project:31 dec.

  2. Re: Error on days   Reply   Report abuse  
Picture of Hugo Pinto Hugo Pinto - 2008-04-02 17:52:08 - In reply to message 1 from pepe
This seems to be a php bug.

On line 568 of gantt.class.php,

REPLACE:
$start += 86400;
WITH:
$start = mktime(date("H",$start),date("i",$start),date("s",$start),date("m",$start),date("d",$start)+1,date("Y",$start));

and That's it.

Hugo

  3. Re: Error on days   Reply   Report abuse  
Picture of Hugo Pinto Hugo Pinto - 2008-04-03 01:09:41 - In reply to message 2 from Hugo Pinto
Well it is not a php bug.
This happens due to daylight saving time.
should be used gmmktime() instead of mktime, in the entire script

Hugo