Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create Custom Dynamic Stamp with Future Date

New Here ,
Aug 12, 2022 Aug 12, 2022

Hello,

 

I am trying to create a custom dynamic stamp that posts a future date. For example, when I open my custom stamp on a document I want the date to display 9 days later. I have followed the tutorial on how to create a custom dynamic stamp, but I am unable to find javascript that will work to output a future date.  I have tried looking online for future date javascript that should theoretically work, but it doesn't work in my stamp or just even when I play around with form fields. Can someone please help?

 

The current date script I have is:

event.value = (new Date()).toString();
AFDate_FormatEx("mmm dd, yyyy");

 

Thank you,

 

Lynnette

TOPICS
JavaScript
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Aug 12, 2022 Aug 12, 2022

Try this:

var d1 = util.scand("mmm dd, yyyy",new Date());
d1.setDate(d1.getDate() +9);
event.value = util.printd("mmm dd, yyyy", d1);

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2022 Aug 12, 2022

Try this:

var d1 = util.scand("mmm dd, yyyy",new Date());
d1.setDate(d1.getDate() +9);
event.value = util.printd("mmm dd, yyyy", d1);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 12, 2022 Aug 12, 2022
LATEST

That's great! Yes, thank you so much. It worked!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines