Skip to main content
Participant
September 18, 2023
Question

Autofill dates by weeknumber

  • September 18, 2023
  • 1 reply
  • 735 views

Hi there,

 

I created a PDF-form so that employees can fill up their working hours per week.

I made a field where they can fill in the starting date of the week in formfield 'startdate'.

I'm new to scripts but would be glad if you can help me out here.

 

I would like to have a script to autofill up the fields 'weeknr', 'enddate' and the sequence of the dates in that week in the fields 'date1' to 'date7'. It's also important that the dates are equal with the calender because not every month has 31 days.

 

Can you please help me fill in the right script?

 

Thank you in advance.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
September 18, 2023

You can find all kinds of generic scripts online that will do that.

Here's one example: https://www.geeksforgeeks.org/calculate-current-week-number-in-javascript/

 

Participant
October 16, 2023

Thank you for your answer, however, I'm a newby so it's looks like a labyrinth to me.

Can you help me out here finding de correct script?

 

Thank you in advance!

try67
Community Expert
Community Expert
October 16, 2023

These tutorials are a good starting point on this subject (which is not trivial):

https://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascript

https://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascript-part-2

https://acrobatusers.com/tutorials/working-date-and-time-acrobat-javascript-part-3-3

 

If you're interested in hiring a professional to create it for you, feel free to contact me privately by clicking my user-name and then on "Send a Message".

 

(en ik spreek Nederlands, als dat helpt...)