Copy link to clipboard
Copied
Hi,
I found in the community page on how to insert auto date in the pdf form.
this.getField("Today").value = util.printd("dd-mm-yyyy", new Date());
But I want to auto populate both date and day (eg 25 Dec 2024, Wednesday) etc..
I am not sure on the JS or how to write the code.
Appreciate any help.
Copy link to clipboard
Copied
Use this format: "dd mmm yyyy dddd"
Copy link to clipboard
Copied
Thank you, pardon my ignorant, where do I put the script ? Can provide the full script. Thanks
Copy link to clipboard
Copied
What do you want the trigger to be? A button click? When the PDF opens? Something else?
Copy link to clipboard
Copied
Thanks for the response, I want to auto populate day each time the pdf opens.
Suceeded to apply JS for my date field [this.getField("Today").value = util.printd("dd-mm-yyyy", new Date());] at Document level.
Not sure about Days though? Refer to sample
Copy link to clipboard
Copied
If you want the format in the example you provided, use @Nesa Nurani 's format example. To update when the document opens, enter as a document level script. You will find all possible date formats in this article.
Copy link to clipboard
Copied
Thank you, guys it woking well!