I would like to calculate the time of the beginning of a treatment, depending on a date and time of a medical exam selected in a field
For example, I select in the fiedl "Date exam" that the exam will be on the 2021/05/31 12H30
so the time for beginning the treatment will be calculated : 12H30 - 6H = 6H30
I don't need to see the date in the result, only the time. The date of the exam with time is written for information at the top of the prescription, this is why I don't use only a time.
I would like also to add or not an additionnal delay of 2 hours, depending on the answer of a radio button "Delay" (yes or not)
the calculation would be : "Exam date" - 6 hours - (2 hours if Yes, 0 hours if Not).
I am not familiar with java script and I searched among forums and could not find a precise answer and examples.
Thank you very much
Read these tutorials to learn how to do time calculations in Acrobat JS:
I've developed some (paid-for) tools that will allow you to set up such calculations quite easily, without having to write any code yourself (such as: https://www.try67.com/tool/acrobat-calculate-time-differences-in-a-worksheet), but it seems your situation is more unique and will require a custom-developed solution. If you're interested in hiring someone to do it for you feel free to contact me privately via [try6767 at gmail.com] to discuss it further.