CALCULATE WARRANTY DATE | WordPress.org

[ad_1]

Hello @robipears

If you have the serial numbers and dates in a database, you will need the DS fields to read the information from the database. The DS fields, distributed with the Developer and Platinum plugin versions, read their values from external data sources, like a database, a CSV file, a JSON structure, previous submissions, ACF, and third-party services via server-side equations. Learn more about DS fields by reading the following blog post:

https://cff.dwbooster.com/blog/2019/02/14/ds

Now, assuming you read the date into the fieldname1, and it has the format dd/mm/yyyy, you can calculate the +30 days and +730 days by using the DATETIMESUM operation, combined with GETDATETIMESTRING to transform the result (date object) into a text with date format.

Insert a calculated field in the form and enter the equation:

GETDATETIMESTRING(DATETIMESUM(fieldname1, 'dd/mm/yyyy', 30, 'd'), 'dd/mm/yyyy')

Insert another calculated field and enter the equation:

GETDATETIMESTRING(DATETIMESUM(fieldname1, 'dd/mm/yyyy', 730, 'd'), 'dd/mm/yyyy')

Learn more about the date/time operations module by reading the following section in the plugin documentation:

https://cff.dwbooster.com/documentation#datetime-module

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