fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15276] booking: date handling


From: sigurdne
Subject: [Fmsystem-commits] [15276] booking: date handling
Date: Mon, 13 Jun 2016 07:39:38 +0000 (UTC)

Revision: 15276
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15276
Author:   sigurdne
Date:     2016-06-13 07:39:37 +0000 (Mon, 13 Jun 2016)
Log Message:
-----------
booking: date handling

Modified Paths:
--------------
    trunk/booking/inc/class.uibooking.inc.php

Modified: trunk/booking/inc/class.uibooking.inc.php
===================================================================
--- trunk/booking/inc/class.uibooking.inc.php   2016-06-10 12:38:32 UTC (rev 
15275)
+++ trunk/booking/inc/class.uibooking.inc.php   2016-06-13 07:39:37 UTC (rev 
15276)
@@ -414,9 +414,11 @@
                                        $this->add_cost_history($booking, 
phpgw::get_var('cost_comment'), phpgw::get_var('cost', 'float'));
                                }
 
-                               $timestamp = strtotime($booking['from_']);
+//                             $timestamp = strtotime($booking['from_']);
+                               $timestamp = 
phpgwapi_datetime::date_to_timestamp($booking['from_']);
                                $booking['from_'] = date("Y-m-d H:i:s", 
$timestamp);
-                               $timestamp = strtotime($booking['to_']);
+//                             $timestamp = strtotime($booking['to_']);
+                               $timestamp = 
phpgwapi_datetime::date_to_timestamp($booking['to_']);
                                $booking['to_'] = date("Y-m-d H:i:s", 
$timestamp);
 
                                if (strlen($_POST['from_']) < 6)
@@ -496,15 +498,15 @@
                                {
                                        if ($_POST['recurring'] == 'on')
                                        {
-                                               $repeat_until = 
strtotime($_POST['repeat_until']) + 60 * 60 * 24;
+                                               $repeat_until = 
phpgwapi_datetime::date_to_timestamp($_POST['repeat_until']) + 60 * 60 * 24;
                                        }
                                        else
                                        {
-                                               $repeat_until = 
strtotime($season['to_']) + 60 * 60 * 24;
+                                               $repeat_until = 
phpgwapi_datetime::date_to_timestamp($season['to_']) + 60 * 60 * 24;
                                                $_POST['repeat_until'] = 
$season['to_'];
                                        }
 
-                                       $max_dato = strtotime($_POST['to_']); 
// highest date from input
+                                       $max_dato = 
phpgwapi_datetime::date_to_timestamp($_POST['to_']); // highest date from input
                                        $interval = $_POST['field_interval'] * 
60 * 60 * 24 * 7; // weeks in seconds
                                        $i = 0;
                                        // calculating valid and invalid dates 
from the first booking's to-date to the repeat_until date is reached
@@ -512,8 +514,8 @@
 
                                        while (($max_dato + ($interval * $i)) 
<= $repeat_until)
                                        {
-                                               $fromdate = date('Y-m-d H:i', 
strtotime($_POST['from_']) + ($interval * $i));
-                                               $todate = date('Y-m-d H:i', 
strtotime($_POST['to_']) + ($interval * $i));
+                                               $fromdate = date('Y-m-d H:i', 
phpgwapi_datetime::date_to_timestamp($_POST['from_']) + ($interval * $i));
+                                               $todate = date('Y-m-d H:i', 
phpgwapi_datetime::date_to_timestamp($_POST['to_']) + ($interval * $i));
                                                $booking['from_'] = $fromdate;
                                                $booking['to_'] = $todate;
                                                $fromdate = 
pretty_timestamp($fromdate);




reply via email to

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