Skip to main content
CalcBuilder logo
CalcBuilder Forum

Inline Day Calculator

User phil_adler

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

Moonsoft support

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

User phil_adler

ok Thanks. So i need to use that if statement for each of the 5 fields correct?

User phil_adler

Awesome thanks so much. The support for your product is OUTSTANDING!!!!!!

Moonsoft support

Hi,
great, thank you, we appreciate the feedback.

Regards

...
List Manager

Build different lists for your site

Buy now!
...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!