Problem of calculating time between two dates with the selected time selector

Status
Not open for further replies.

MILORD65

Member
Hello,
I have a problem with a calculation of time between two dates:
I have two date fields with the time selector. I created a calc field that calculates the difference between these two dates in minutes using the formula:

$nowdate = strtotime("{t_reg_accueil___heure_accueil}");
$thendate = strtotime("{t_reg_accueil___heure_prise_en_charge}");
$datediff = ($thendate - $nowdate);
$diff = round($datediff / 60);
return $diff;

And I get in the fabrik list good results but ... not in the table of the mysql database where the value 0 is displayed.

If I don't select the time selector good results are displayed in the fabrik list and in the table in the database!

How do the results displayed in the fabrik table and the table of the mysql database with the selected time selector?
The time selector are essential in my form to enter the hours.
Thank you for your help.
 
I also tried with two time elements and a calc element that calculates the difference between the two and it does not work for the database.
 
yup same problem.
i've fixed this (I believe) by backporting a similar fix we did in 3.1 a couple of weeks ago. For my test case the calculation code now works as expected, and your example should work without the need to alter it.

-Rob
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top