Heads Up: This is the documentation for Joomla 3

We recommend using the Documentation for Joomla 4!

It is more up-to-date and extensive. Most of it applies retrospectively to Joomla 3.

Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Use date fields in calculations

This feature is part of the Visforms Subscription and not available in the free Visforms version..

We propose reading the documentation from the beginning, starting with the Introduction. We will not repeat concepts and explanations made in previous parts of the documentation, here.

New in Visforms Subscription 3.0.0

Because being able to use date fields in calculations was heighly sought after, we have added this feature to the Visforms Subscription in version 3.0.0.

Using date fields in calculations is interesting if you have a booking form and it allows you to calculate the difference in days between the values of two date fields.

How it works

If a date field is empty, Visforms will set the calculation value for this field (the value used for this field in the calculation) to 0.

If a date is picked, Visforms will convert it to a unix time stamp. This is the amount of seconds passed since January 1st, 1970. Visforms will transform this time difference into a time difference in days. In order to get accurate values, all time stampls are converted to UTC first and the time is set to 00:00:00.

This allows you to calculate the day difference between the values of two date fields.

Examples

We assume that the date fields, used in the calculation are named startdate and enddate:

Include first and last day in calculation

([ENDDATE]-([STARTDATE])) + 1

Include only first day or last day in calculation

([ENDDATE]-([STARTDATE]))

We propose, that you make date fields that are used in calculations, required fields.

As you can see, using date fields in calculations is quite easy. But please note, that there are only limited options to control the user inputs in date fields. There is no validation available that makes sure, that the value in one date field is higher than in another, for example.

Back to list Find suitable subscription