Forum
Calc Builder Support
Calc Builder supportForums
No se permite escribir sin estar logado. Por favor, login
Inline Day Calculator 08.02.2016 16:54
I have made with your help a custom count # of days calendar. The results show up inline.
However whenever I choose the startdate the enddate is automatically choosing todays date even though it does not show up in the end date date picker. How can I prevent the end date from automatically assigning the todays date value before a end date is chosen. I have set the default to 0
However whenever I choose the startdate the enddate is automatically choosing todays date even though it does not show up in the end date date picker. How can I prevent the end date from automatically assigning the todays date value before a end date is chosen. I have set the default to 0
Re: Inline Day Calculator 08.02.2016 17:23
Hi,
if the field is empty, the date creation you use for calculate creates a 'today' date by default. What you need now is to set the result to 0 if any of the fields is not present, right?. Then you need an 'if/else' structure: Given startdate and enddate...
//if any of the date fields is empty
if($startdate==""||$enddate==""){
//set the result to 0
$days=0;
}
else{
//copy here your days calculation you had before
}
Hope this helps, regards
Moonsoft Team
www.moonsoft.es
if the field is empty, the date creation you use for calculate creates a 'today' date by default. What you need now is to set the result to 0 if any of the fields is not present, right?. Then you need an 'if/else' structure: Given startdate and enddate...
//if any of the date fields is empty
if($startdate==""||$enddate==""){
//set the result to 0
$days=0;
}
else{
//copy here your days calculation you had before
}
Hope this helps, regards
Moonsoft Team
www.moonsoft.es