Home > Forum > Rules, JS, SQL > AddDate() function for DateTime fields

AddDate() function for DateTime fields
0

Hi all,

I have a question about calculating a Date to field based on two other fields in WEBCON.

I have:

Date from – DateTime field

Time (h) – Choice field (values like: 1, 1.5, 2, etc.)

Date to – DateTime field

I want Date to to be automatically calculated as:

Date to = Date from + Time (h) hours

I tried to use a form rule, but I keep getting an error in the Date to field.

Has anyone implemented a similar calculation?
What is the recommended way (formula / ADD DATE / JavaScript) to achieve this?

Thanks in advance for your help!