Date calculation (add 1 year)

13 February, 2023 03:47:55
Colemont
Topics: 7
Messages: 19
Hi guys, i can't manage to calculate date. What i need to is select a date field from questionaire and add 1 year.

Tried this shortcode, but i am getting my calculation as "1971-01-01". Where is the mistake?

[e2pdf-format-date offset="+365 days"][e2pdf-wc-order key="line_item" subkey="Insurance from" index="0" order_item_meta="true"][/e2pdf-format-date]
13 February, 2023 03:49:33
E2Pdf
Support
Topics: 7
Messages: 3345
Hi,

Can you let us know please what is the default output of the shortcode?:

[e2pdf-wc-order key="line_item" subkey="Insurance from" index="0" order_item_meta="true"]
We would really appreciate your feedback at WordPress.org!
13 February, 2023 03:58:30
Colemont
Topics: 7
Messages: 19
For example: 2023.02.14 - it is a date selector from Checkout Field Editor for WooCommerce plugin.
13 February, 2023 04:14:12
E2Pdf
Support
Topics: 7
Messages: 3345
Try to use please construction as follows:

[e2pdf-format-date offset="+365 days"][e2pdf-format-output search="." replace="/"][e2pdf-wc-order key="line_item" subkey="Insurance from" index="0" order_item_meta="true"][/e2pdf-format-output][/e2pdf-format-date]
We would really appreciate your feedback at WordPress.org!
13 February, 2023 04:34:07
Colemont
Topics: 7
Messages: 19
Ok, now the calculation works and i get the result as "2024-02-28" ("-" separator) but i still need to get back to original date format which would be "2024.02.28" ("." separator), how should i modify it?
13 February, 2023 04:34:09
Colemont
Topics: 7
Messages: 19
Ok, now the calculation works and i get the result as "2024-02-28" ("-" separator) but i still need to get back to original date format which would be "2024.02.28" ("." separator), how should i modify it?
13 February, 2023 04:40:50
E2Pdf
Support
Topics: 7
Messages: 3345
It need to use the "format" attribute as:

[e2pdf-format-date format="Y.m.d" offset="+365 days"][e2pdf-format-output search="." replace="/"][e2pdf-wc-order key="line_item" subkey="Insurance from" index="0" order_item_meta="true"][/e2pdf-format-output][/e2pdf-format-date]
We would really appreciate your feedback at WordPress.org!
13 February, 2023 06:11:00
Colemont
Topics: 7
Messages: 19
This doesn't work anymore, i am getting empty field.
13 February, 2023 06:18:05
E2Pdf
Support
Topics: 7
Messages: 3345
Attach please screenshot from the "Value" as it looks like you can miss some quotes.
We would really appreciate your feedback at WordPress.org!
13 February, 2023 06:44:50
Colemont
Topics: 7
Messages: 19
It was my mistake, a quote was missing. Sorry for disturbing. You are epic as always <3