Difference between days between dates

peppe10

Member
Can you make the difference between days between two date type fields?

field 1 - 01-01-2017
field 1 - 31-01-2017
field 3 - 30 day (automatic)

Thank you
 
You could probably use a calc element. Something like ...

PHP:
$date1 =new DateTime('{yourtable___field1_raw}');
$date2 =new DateTime('{yourtable___field2_raw}');

return $date2->diff($date1)->format("%a");

-- hugh
 
Not from my phone I can't. Just go to the main site, downloads link at top of page, find the calc element plugin.

Sent from my HTC6545LVW using Tapatalk
 
hello
I installed the plugin.
I saw in the module plugin but there is no calc.
Where do I have to place the code above posted?
 
Did you enable it? If it's installed and enabled, it should show up as an available element type.

(Joomla doesn't enable plugins by default when you install them, you have to manually enable them)

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top