Add days to a date picker

7 views
Skip to first unread message

danieldotnet

unread,
Jul 17, 2019, 5:34:25 PM7/17/19
to orb...@googlegroups.com
I would like to add 14 days to the selected date, only then should the entry
be valid. Specifically: If the selected date is further in the future than
+14 days then the entry is valid.
How can I do this in the XPath field (validation)?

I found this here, but it doesn't work.
days-to-date(days-from-date(local-date()) + 30)

My control is only date - without time.
Thank you for your help.

--
Sent from: http://discuss.orbeon.com/

Alessandro Vernet

unread,
Jul 18, 2019, 1:43:30 PM7/18/19
to orb...@googlegroups.com
Hi Daniel,

I think that you're looking for the following:

days-from-duration(. - current-date()) >= 14

You'll let me know if this works for you,

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet

danieldotnet

unread,
Jul 26, 2019, 1:32:08 AM7/26/19
to orb...@googlegroups.com
Hi Alessandro
Great, thank you.
This is exactly what I was looking for. It works.

Best regards,
Daniel

Alessandro Vernet

unread,
Jul 26, 2019, 4:51:25 PM7/26/19
to orb...@googlegroups.com
Excellent Daniel, I'm glad that date validation expression worked, and thank
you for the confirmation.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply all
Reply to author
Forward
0 new messages