dimoss
Well-Known Member
Hi
I have a calc element in order to calculate the difference between two dates in years, months, days:
I have put 'Calc on save' to No because I want to calculate on the fly for each row.
It works ok BUT there is strange problem and the result is not shown on the correct position (last list column) but on the top and instead of this I get just a number in each list row!!
See the screenshot:
Any ideas??
Thanks.
I have a calc element in order to calculate the difference between two dates in years, months, days:
PHP:
$date1 = '{fab_tekna___dob}';
$date2 = date('Y-m-d h:i:s');
$diff = abs(strtotime($date2) - strtotime($date1));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24) / (60*60*24));
return printf("%d years, %d months, %d days\n", $years, $months, $days);
I have put 'Calc on save' to No because I want to calculate on the fly for each row.
It works ok BUT there is strange problem and the result is not shown on the correct position (last list column) but on the top and instead of this I get just a number in each list row!!
See the screenshot:
Any ideas??
Thanks.