Number and Date Relationship | WordPress.org

[ad_1]

Hello @pexel

Thank you very much for using our plugin.

If the feldname1 is a date field, and the number fields fieldname19 has a year value, fieldname20 months, fieldname21 weeks, and fieldname22 days, and you want to sum them to the date field and get the result in date format. You can insert a calculated field in the form and enter the following equation:

(function(){
var result = fieldname1;

result = DATETIMESUM(result, 'dd/mm/yyyy', fieldname19, 'y');
result = DATETIMESUM(result, 'dd/mm/yyyy', fieldname20, 'm');
result = DATETIMESUM(result, 'dd/mm/yyyy', fieldname21*7+fieldname22, 'd');

return GETDATETIMESTRING(result, 'dd/mm/yyyy');
})()

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer