Forum
Calc Builder Support
Calc Builder supportForums
Public write access is disabled. Please login
Re: Count number of days 02.02.2016 17:58
Hi,
yes, we can provide that one. We assume you have created a couple of date fields at your form, please share which is the date format you're using (the one you've set at Preferences->front end date format) for your calculator.
Regards
Moonsoft Team
www.moonsoft.es
yes, we can provide that one. We assume you have created a couple of date fields at your form, please share which is the date format you're using (the one you've set at Preferences->front end date format) for your calculator.
Regards
Moonsoft Team
www.moonsoft.es
Re: Count number of days 03.02.2016 11:58
Hi,
ok, assuming your field dates variables are called 'startdate' and 'endddate', the code would be:
$format="m/d/Y";
$date1 = date_create_from_format($format,$startdate);
$date2 = date_create_from_format($format,$endddate);
$diff = date_diff($date1, $date2);
$days = $diff->d;
Now you have the difference at $days, that you can use for further calculations or print at the exit layout with ##days##
Please note those date functions above are valid starting from php 5.3, if you have an older version let us know so we'll provide another approach to get this result.
Please let us know if you need more help with this.
Regards
Moonsoft Team
www.moonsoft.es
ok, assuming your field dates variables are called 'startdate' and 'endddate', the code would be:
$format="m/d/Y";
$date1 = date_create_from_format($format,$startdate);
$date2 = date_create_from_format($format,$endddate);
$diff = date_diff($date1, $date2);
$days = $diff->d;
Now you have the difference at $days, that you can use for further calculations or print at the exit layout with ##days##
Please note those date functions above are valid starting from php 5.3, if you have an older version let us know so we'll provide another approach to get this result.
Please let us know if you need more help with this.
Regards
Moonsoft Team
www.moonsoft.es
Re: Count number of days 03.02.2016 17:34
Hi,
you can enable bootstrap classes from the preferences tab, that will make the fields to adopt the bootstrap look and feel, otherwise they will be inheriting the styles from your template. If you want to add some more styles to the form, you can use the 'form layout' html editor, and also the js tab 'write directly in html page' if you want to include any external css file or style tag (this tab works including all its content inside the page)
Hope this helps, regards
Moonsoft Team
www.moonsoft.es
you can enable bootstrap classes from the preferences tab, that will make the fields to adopt the bootstrap look and feel, otherwise they will be inheriting the styles from your template. If you want to add some more styles to the form, you can use the 'form layout' html editor, and also the js tab 'write directly in html page' if you want to include any external css file or style tag (this tab works including all its content inside the page)
Hope this helps, regards
Moonsoft Team
www.moonsoft.es
Re: Count number of days 08.02.2016 17:25
Hi,
the reason is that you're adding one day to 'today'. If you don't want to show a result when any of the dates is empty, you can check this post regarding same question:
https://www.moonsoft.es/en/help/2/3299-inline-day-calculator
Regards
Moonsoft Team
www.moonsoft.es
the reason is that you're adding one day to 'today'. If you don't want to show a result when any of the dates is empty, you can check this post regarding same question:
https://www.moonsoft.es/en/help/2/3299-inline-day-calculator
Regards
Moonsoft Team
www.moonsoft.es