phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r495 - trunk/rapport_avance/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r495 - trunk/rapport_avance/include
Date: Wed, 8 May 2013 14:42:08 +0200 (CEST)

Author: danydb
Date: 2013-05-08 14:42:07 +0200 (Wed, 08 May 2013)
New Revision: 495

Modified:
   trunk/rapport_avance/include/class_rapav_declaration.php
Log:
Bug in datetime constructor, a format is given

Modified: trunk/rapport_avance/include/class_rapav_declaration.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_declaration.php    2013-05-07 
23:57:44 UTC (rev 494)
+++ trunk/rapport_avance/include/class_rapav_declaration.php    2013-05-08 
12:42:07 UTC (rev 495)
@@ -405,16 +405,16 @@
        {
                static $s_start = "";
                static $s_count = 0;
-
+            
                if ($s_start == "")
                {
                        $s_start = $p_start;
                }
                $s_count++;
                // initialize datetime object
-               $date_start = new DateTime(format_date($s_start, 'DD.MM.YYYY', 
'YYYY/MM/DD'));
-               $date_end = new DateTime(format_date($s_start, 'DD.MM.YYYY', 
'YYYY/MM/DD'));
-               $date_finish = new DateTime(format_date($p_end, 'DD.MM.YYYY', 
'YYYY/MM/DD'));
+               $date_start = DateTime::createFromFormat('d.m.Y',$s_start);
+               $date_end = DateTime::createFromFormat('d.m.Y',$s_start);
+               $date_finish = DateTime::createFromFormat('d.m.Y',$p_end);
 
                $add = $this->get_interval($p_step);
 
@@ -423,10 +423,8 @@
                // compute date_end
                $date_end->add($add);
                $date_end->sub(new DateInterval('P1D'));
-
                // if date_end > date_finish then stop
                if ($date_end > $date_finish)                   return 0;
-
                $this->start = $date_start->format("d.m.Y");
                $this->end = $date_end->format("d.m.Y");
                $s_start = $this->start;



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

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