Add days to a date

maxinic

Member
Hello, I'm doing a bookings register
In this register I have an initial date field and a nights field
I can't add the starting date to the nights

I tried this



I have a calc element named End:

$night= (int) ('{registro_foresteria___num_notti}');
return "'".date('d-m-Y', strtotime('{registro_foresteria___start}' . '+ '. $night. ' day'))."'";

Ex.

Start: 08-06-2021
Night:2

it return 08-06-2021
 
No :(
For me the problem is here:

$night= (int) ('{registro_foresteria___num_notti}');
return "'".date('d-m-Y', strtotime('{registro_foresteria___start}' . '+ '. $night. ' day'))."'";

it return correctly the date in '{registro_foresteria___start}' but it does not add up
 
Var_dump or dump (jdump extension) what you get where.
Depending on your element settings {registro_foresteria___num_notti} may contain a link, that's why I said try _raw
{registro_foresteria___num_notti_raw}
 
Solved.
i only change name from {registro_foresteria___num_notti} to {registro_foresteria___notti}, and add _raw. ;) Thanks troester
 
Another little problem.
It return date like '10-06-2021'. So when i found a date like 10-06-2021 finds nothing.
is there a way to delete the quotes?
I also thought about copying the result of the calc element into another date element but I don't know how to do it
 
Sorry, but why it is not saved in the database?
In Php myadmin nothing is saved
I set "Save to database"=Yes
:confused:
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top